summaryrefslogtreecommitdiffstats
path: root/t/random-permutation.t
diff options
context:
space:
mode:
Diffstat (limited to 't/random-permutation.t')
-rw-r--r--t/random-permutation.t20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/random-permutation.t b/t/random-permutation.t
new file mode 100644
index 0000000..ca9f004
--- /dev/null
+++ b/t/random-permutation.t
@@ -0,0 +1,20 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+
+use Games::Word qw(random_permutation);
+
+is(random_permutation(""), "", "testing permutation of empty string");
+
+for my $word (qw/foo bar baz quux blah/) {
+ for (1..10) {
+ is_deeply(
+ [sort split //, random_permutation($word)],
+ [sort split //, $word],
+ "random tests"
+ );
+ }
+}
+
+done_testing;