1N/A chdir 't' if -d 't'; 1N/Aprint join(':',1..5) eq '1:2:3:4:5' ?
"ok 1\n" :
"not ok 1\n";
1N/Aprint join(':',@bar[1..5]) eq ':c:d:e:' ?
"ok 3\n" :
"not ok 3\n";
1N/A($a,@bcd[0..2],$e) =
('a','b','c','d','e');
1N/Aprint join(':',$a,@bcd[0..2],$e) eq 'a:b:c:d:e' ?
"ok 4\n" :
"not ok 4\n";
1N/Aprint $x ==
5050 ?
"ok 5\n" :
"not ok 5 $x\n";
1N/Afor ((100,2..99,1)) { 1N/Aprint $x ==
5050 ?
"ok 6\n" :
"not ok 6 $x\n";
1N/Aprint $x
eq 'abcdefghijklmnopqrstuvwxyz' ?
"ok 7\n" :
"not ok 7 $x\n";
1N/Aprint @x ==
27 *
26 ?
"ok 8\n" :
"not ok 8\n";
1N/A@x =
'09' ..
'08';
# should produce '09', '10',... '99' (strange but true) 1N/A# same test with foreach (which is a separate implementation) 1N/Aforeach ('09'..'08') { 1N/A @a = eval "0x7ffffffffffffffe..0x7fffffffffffffff"; 1N/A $a = "9223372036854775806 9223372036854775807"; 1N/A @b = eval "-0x7fffffffffffffff..-0x7ffffffffffffffe"; 1N/A $b = "-9223372036854775807 -9223372036854775806"; 1N/A @a = eval "0x7ffffffe..0x7fffffff"; 1N/A $a = "2147483646 2147483647"; 1N/A @b = eval "-0x7fffffff..-0x7ffffffe"; 1N/A $b = "-2147483647 -2147483646"; 1N/A $x =~ s/(\w)-(\w)/join ':', $1 .. $2/e; 1N/A print $bad ? "not ok 13\n" : "ok 13\n"; 1N/A# Should use magical autoinc only when both are strings 1N/Afor my $x ("0"..-1) { 1N/A# [#18165] Should allow "-4".."0", broken by #4730. (AMS 20021031) 1N/Aprint join(":","-4".."0") eq "-4:-3:-2:-1:0" ? "ok 16\n" : "not ok 16\n"; 1N/Aprint join(":","-4".."-0") eq "-4:-3:-2:-1:0" ? "ok 17\n" : "not ok 17\n"; 1N/Aprint join(":","-4\n".."0\n") eq "-4:-3:-2:-1:0" ? "ok 18\n" : "not ok 18\n"; 1N/Aprint join(":","-4\n".."-0\n") eq "-4:-3:-2:-1:0" ? "ok 19\n" : "not ok 19\n"; 1N/A# undef should be treated as 0 for numerical range 1N/A# undef should be treated as "" for magical range 1N/Aprint join(":", map "[$_]", "".."B") eq '[]' ? "ok 24\n" : "not ok 24\n"; 1N/Aprint join(":", map "[$_]", "B".."") eq '' ? "ok 26\n" : "not ok 26\n"; 1N/A# also test undef in foreach loops 1N/Aprint join(":", @foo) eq '0:1:2' ? "ok 29\n" : "not ok 29\n"; 1N/Aprint join(":", @foo) eq '-2:-1:0' ? "ok 30\n" : "not ok 30\n"; 1N/Aprint join(":", @foo) eq '0:1:2' ? "ok 31\n" : "not ok 31\n"; 1N/Aprint join(":", @foo) eq '-2:-1:0' ? "ok 32\n" : "not ok 32\n";