The bulk of this test script tests whether ops which are capable of
the OA_TARGLEX optimisation return the same results with lexical and
package var assignments, i.e.
my $a;
$a = OP;
$b = OP;
is($a,$b);
When OP is 'time', the two calls can return different times, resulting in
occasional intermittent failures. So move time into it's custom test which
can cope with a delta of 1.
Similarly if the op is <*>, parallel testing can result in temporary files
appearing in the current directory, resulting in different returns.
However, since glob doesn't actually have the 'T' (OA_TARGLEX) set in
regen/opcodes, this test is moot - so skip it.
If glob ever does ever get OA_TARGLEX, and so need to be tested, it may
require some subtlety, such as globbing for a pattern that won't match any
temporary files.
}
}
+# time() can't be tested using the standard framework since two successive
+# calls may return differing values.
+
+{
+ my $a;
+ $a = time;
+ $b = time;
+ my $diff = $b - $a;
+ cmp_ok($diff, '>=', 0, "time is monotically increasing");
+ cmp_ok($diff, '<', 2, "time delta is small");
+}
+
done_testing();
ref $cstr # ref nonref
`$runme -e "print qq[1\\n]"` # backtick skip(MSWin32)
`$undefed` # backtick undef skip(MSWin32)
-<*> # glob
+'???' # glob (not currently OA_TARGLEX)
<OP> # readline
'faked' # rcatline
(@z = (1 .. 3)) # aassign
setpgrp # setpgrp
getpriority $$, $$ # getpriority
'???' # setpriority
-time # time
+'???' # time
localtime $^T # localtime
gmtime $^T # gmtime
'???' # sleep: can randomly fail