summaryrefslogtreecommitdiffstats
path: root/t/slices.t
diff options
context:
space:
mode:
Diffstat (limited to 't/slices.t')
-rw-r--r--t/slices.t21
1 files changed, 21 insertions, 0 deletions
diff --git a/t/slices.t b/t/slices.t
new file mode 100644
index 0000000..584dd43
--- /dev/null
+++ b/t/slices.t
@@ -0,0 +1,21 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+
+my @nums = (1..10);
+
+{
+ use smartmatch sub {
+ return ref $_[0] eq 'ARRAY'
+ && ref $_[1] eq 'ARRAY'
+ && @{ $_[0] } == @{ $_[1] };
+ };
+ ok(@nums[0..-1] ~~ []);
+ ok(!(@nums[0..1] ~~ [0..2]));
+ ok(@nums[0..4] ~~ [1..5]);
+ ok(!(undef ~~ @nums[0..-1]));
+ ok(!(@nums[0..1] ~~ 2));
+}
+
+done_testing;