Skip to content

Commit ae590ca

Browse files
committed
[cookbook] add a test for 13classes-objects-and-ties
1 parent 9251efb commit ae590ca

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
use v6;
2+
3+
use Test;
4+
5+
plan 1;
6+
7+
subtest {
8+
plan 1;
9+
10+
my $example-name = "13-01constructing-an-object.pl";
11+
my $expected-output = "Yes";
12+
13+
my $output = run-example($example-name);
14+
is($output.chomp, $expected-output, $example-name);
15+
}, "13-01constructing-an-object.pl";
16+
17+
#| run the given example script
18+
sub run-example($name, :$script-args = Nil) {
19+
my $base-dir = "categories/cookbook/13classes-objects-and-ties";
20+
my $script-path = $base-dir ~ "/" ~ $name;
21+
my $base-cmd = "perl6 $script-path";
22+
my $output = $script-args ?? qqx{$base-cmd \"$script-args\"}
23+
!! qqx{$base-cmd};
24+
25+
return $output;
26+
}
27+
28+
# vim: expandtab shiftwidth=4 ft=perl6

0 commit comments

Comments
 (0)