diff options
author | dakkar <dakkar@thenautilus.net> | 2011-08-29 18:22:24 +0100 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2011-08-29 18:23:00 +0100 |
commit | c802d62a3afc99c784cfbb7ca2033930d6537555 (patch) | |
tree | 885cab58e5f1426b28f8f8899bc9e51b9d766a55 /t/lib/Test/Enigmatic.pm | |
parent | plugboard (diff) | |
download | Enigmatic-c802d62a3afc99c784cfbb7ca2033930d6537555.tar.gz Enigmatic-c802d62a3afc99c784cfbb7ca2033930d6537555.tar.bz2 Enigmatic-c802d62a3afc99c784cfbb7ca2033930d6537555.zip |
full-machine and tests
Diffstat (limited to 't/lib/Test/Enigmatic.pm')
-rw-r--r-- | t/lib/Test/Enigmatic.pm | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/t/lib/Test/Enigmatic.pm b/t/lib/Test/Enigmatic.pm index 923ede1..9958667 100644 --- a/t/lib/Test/Enigmatic.pm +++ b/t/lib/Test/Enigmatic.pm @@ -13,3 +13,28 @@ sub test_static_map { "$name on $c"); } } + + +sub test_full_machine { + my ($factory,$input,$exp_output) = @_; + + $input =~ s{\s+}{}g; + + my $output = $factory->()->map_string(uc $input); + + note "output: $output"; + + my $back = $factory->()->map_string($output); + + note "back: $back"; + + is($back, + $input, + 'round tripped'); + if ($exp_output) { + $exp_output =~ s{\s+}{}g; + is($output, + uc($exp_output), + 'got expected output'); + } +} |