diff options
author | dakkar <dakkar@thenautilus.net> | 2011-08-29 14:24:53 +0100 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2011-08-29 14:24:53 +0100 |
commit | ebae593425aef965ca2504db727c56e70d308d87 (patch) | |
tree | a69b4a03d646232fd8383dbf870ca90bbdd41eb1 /t/rotors.t | |
parent | test ring_setting is writable (diff) | |
download | Enigmatic-ebae593425aef965ca2504db727c56e70d308d87.tar.gz Enigmatic-ebae593425aef965ca2504db727c56e70d308d87.tar.bz2 Enigmatic-ebae593425aef965ca2504db727c56e70d308d87.zip |
notches
Diffstat (limited to 't/rotors.t')
-rw-r--r-- | t/rotors.t | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -67,6 +67,18 @@ subtest 'rotor box' => sub { Beta => 'LEYJVCNIXWPBQMDRTAKZGFUHOS', Gamma => 'FSOKANUERHMBTIYCWLQPZXVGJD', ); + my %notch_at = ( + I => ['Q'], + II => ['E'], + III => ['V'], + IV => ['J'], + V => ['Z'], + VI => ['Z','M'], + VII => ['Z','M'], + VIII => ['Z','M'], + Beta => [], + Gamma => [], + ); my $box = Enigmatic::RotorBox->new(); @@ -77,6 +89,21 @@ subtest 'rotor box' => sub { Test::Enigmatic::test_static_map( $r,$out, "rotor $rotor from box"); + + my @notches = $notch_at{$rotor}->flatten; + my @not_notches = do { + my %tmp;@tmp{'A'..'Z'}=(); + delete @tmp{@notches}; + keys %tmp; + }; + for my $l (@notches) { + ok($r->has_notch_at($l), + "rotor $rotor has notch at $l"); + } + for my $l (@not_notches) { + ok(! $r->has_notch_at($l), + "rotor $rotor has no notch at $l"); + } }); }; |