From 53099361ccac273f69fea1f7739d884db52bbf1a Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 10 Jul 2011 04:35:36 -0500 Subject: hack around a parsing bug in earlier perls this may preclude us from being able to implement bug-compatible engines from both 5.12 and 5.14, but... shrug, can deal with that later if we decide we care --- t/slices.t | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 t/slices.t (limited to 't') 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; -- cgit v1.2.3-54-g00ecf