diff options
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"); + } }); }; |