summaryrefslogtreecommitdiff
path: root/t/rotors.t
diff options
context:
space:
mode:
Diffstat (limited to 't/rotors.t')
-rw-r--r--t/rotors.t27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/rotors.t b/t/rotors.t
index 9e0b2f8..4676a55 100644
--- a/t/rotors.t
+++ b/t/rotors.t
@@ -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");
+ }
});
};