diff options
author | dakkar <dakkar@thenautilus.net> | 2011-08-29 19:16:26 +0100 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2011-08-29 19:16:26 +0100 |
commit | 2b28ab91084f37a5e9014737d0df694587fe60cf (patch) | |
tree | 5aa4089d4b3589584d1b6e945184a2fad51b62e6 /t/full-enigma.t | |
parent | full-machine and tests (diff) | |
download | Enigmatic-2b28ab91084f37a5e9014737d0df694587fe60cf.tar.gz Enigmatic-2b28ab91084f37a5e9014737d0df694587fe60cf.tar.bz2 Enigmatic-2b28ab91084f37a5e9014737d0df694587fe60cf.zip |
fixed rotor ring settings
and removed debug prints
Diffstat (limited to 't/full-enigma.t')
-rw-r--r-- | t/full-enigma.t | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/t/full-enigma.t b/t/full-enigma.t index 0015b46..872b199 100644 --- a/t/full-enigma.t +++ b/t/full-enigma.t @@ -1,6 +1,6 @@ #!perl use DAKKAR::p 'test'; - +use Test::Enigmatic; use Enigmatic::Machine; sub real_machine { @@ -27,7 +27,6 @@ SSEN ACHX EKNS VIER MBFA ELLT YNNN NNNO OOVI ERYS ICHT EINS NULL EOPLAIN -$plaintext =~ s{\s+}{}g; my $ciphertext = <<'EOCIPHER'; NCZW VUSX PNYM INHZ XMQX @@ -43,27 +42,11 @@ ANJM OLBG FFLE OPRG TFLV RHOW OPBE KVWM UQFM PWPA RMFH AGKX IIBG EOCIPHER -$ciphertext =~ s{\s+}{}g; - -note "encrypt real"; - -my $check = real_machine->map_string($plaintext); -p $check; -is($check,$ciphertext, - 'ok crypt'); - -note "round-trip check"; - -$check = real_machine->map_string($check); -p $check; -is($check,$plaintext, - 'round tripped'); - -note "decrypt real"; -$check = real_machine->map_string($ciphertext); -p $check; -is($check,$plaintext, - 'ok plain'); +Test::Enigmatic::test_full_machine( + \&real_machine, + $plaintext, + $ciphertext); +done_testing(); |