From 2b28ab91084f37a5e9014737d0df694587fe60cf Mon Sep 17 00:00:00 2001 From: dakkar Date: Mon, 29 Aug 2011 19:16:26 +0100 Subject: fixed rotor ring settings and removed debug prints --- t/full-enigma.t | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) (limited to 't/full-enigma.t') 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(); -- cgit v1.2.3