Game-Senet
view release on metacpan or search on metacpan
t/33-synopsis.t view on Meta::CPAN
: is($said, $want, 'it prints this and nothing else');
}
my (undef, undef, $again) = run_capturing("$before\n$code\n$after");
is($again, $said, 'and run twice it prints the same: the seed is in it');
};
}
subtest 'Game::Senet::Terminal' => sub {
my $code = synopsis_of('Game::Senet::Terminal');
ok(defined $code && $code =~ /->run\(\@ARGV\)/, 'it has a synopsis, and it runs the program');
local @ARGV = ('--version');
$exited = undef;
my ($ok, $error, $said) = run_capturing($code);
is($error, "exit was called\n", 'the first line runs and leaves through exit, as a program does');
is($exited, 0, ' with 0');
like($said, qr/\Asenet \d+\.\d+\n\z/, ' having done what --version asks');
ok(eval("package Local::Compiled; no strict 'vars'; my \$compiled = sub { $code }; 1"), 'and the whole of it compiles')
or diag($@);
};
done_testing();
( run in 1.132 second using v1.01-cache-2.11-cpan-ac8be02dad9 )