projects
/
p5sagit/p5-mst-13.2.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Small optimisations, by Brandon Black
[p5sagit/p5-mst-13.2.git]
/
t
/
op
/
context.t
1
#!./perl
2
3
BEGIN {
4
chdir 't' if -d 't';
5
@INC = qw(. ../lib);
6
}
7
8
require "test.pl";
9
plan( tests => 7 );
10
11
sub foo {
12
$a='abcd';
13
$a=~/(.)/g;
14
cmp_ok($1,'eq','a','context ' . curr_test());
15
}
16
17
$a=foo;
18
@a=foo;
19
foo;
20
foo(foo);
21
22
my $before = curr_test();
23
$h{foo} = foo;
24
my $after = curr_test();
25
26
cmp_ok($after-$before,'==',1,'foo called once')
27
or diag("nr tests: before=$before, after=$after");