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/simple-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/simple-enigma.t')
-rw-r--r-- | t/simple-enigma.t | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/t/simple-enigma.t b/t/simple-enigma.t index b2bcbdd..889f0c0 100644 --- a/t/simple-enigma.t +++ b/t/simple-enigma.t @@ -1,6 +1,6 @@ #!perl use DAKKAR::p 'test'; - +use Test::Enigmatic; use Enigmatic::Machine; sub real_machine { @@ -13,11 +13,8 @@ sub real_machine { }); } -my $plaintext = 'this is a simple text to be encrypted by an enigma machine'->uc; -note "encrypt simple"; -my $ciphertext = real_machine->map_string($plaintext);note $ciphertext; -note "decrypt simple"; -my $check = real_machine->map_string($ciphertext);note $check; -$plaintext =~ s{\s+}{}g; -is($check,$plaintext, - 'round tripped'); +Test::Enigmatic::test_full_machine( + \&real_machine, + 'this is a simple text to be encrypted by an enigma machine'); + +done_testing(); |