]> git.vpit.fr Git - perl/modules/Sub-Nary.git/blobdiff - t/21-list.t
Add support for constant ranges, and tests for kinds all ranges
[perl/modules/Sub-Nary.git] / t / 21-list.t
index 6de15c23d91bab35ceca6fd55a78f0e44fee5c1c..3acf6593eeb4a83aca744724fdbf8963d65bb5a3 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 36;
+use Test::More tests => 40;
 
 use Sub::Nary;
 
@@ -40,8 +40,12 @@ my @tests = (
  [ sub { $x, @a },           'list' ],
  [ sub { %h, $y },           'list' ],
 
- [ sub { 1 .. 3 },           'list' ],
- [ sub { my @a = (1 .. 4) }, 4 ],
+ [ sub { 1 .. 3 },                  3 ],
+ [ sub { $x .. 3 },                 'list' ],
+ [ sub { 1 .. $x },                 'list' ],
+ [ sub { '2foo' .. 4 },             3 ],
+ [ sub { my @a = (7, 8); @a .. 4 }, 'list' ],
+ [ sub { my @a = (1 .. 4) },        4 ],
 
  [ sub { "banana" =~ /(a)/g }, 'list' ],