Skip to content

Instantly share code, notes, and snippets.

@ingydotnet
Created September 8, 2010 06:44
Show Gist options
  • Save ingydotnet/569735 to your computer and use it in GitHub Desktop.
Save ingydotnet/569735 to your computer and use it in GitHub Desktop.
> cat t/x.t
use TestML -run;
sub f1 {
my $context = shift;
my $num = shift->value;
return $num * 42 + $num;
}
sub f2 {
my $context = shift;
my $num = shift->value;
return $num * $num + $num;
}
__DATA__
%TestML 1.0
Plan = 6;
myFun = (a, b, c) {
f1(a) == b;
f2(a) == c;
};
myFun(*input, *output1, *output2);
=== One
--- input: 1
--- output1: 43
--- output2: 2
=== Two
--- input: 2
--- output1: 86
--- output2: 6
=== Three
--- input: 5
--- output1: 215
--- output2: 30
> prove -lv t/x.t
t/x.t ..
1..6
ok 1 - One
ok 2 - One
ok 3 - Two
ok 4 - Two
ok 5 - Three
ok 6 - Three
ok
All tests successful.
Files=1, Tests=6, 0 wallclock secs ( 0.03 usr 0.00 sys + 0.06 cusr 0.00 csys = 0.09 CPU)
Result: PASS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment