Seis
view release on metacpan or search on metacpan
share/seislib/Test.pm view on Meta::CPAN
$num_of_tests_run++;
print "ok $num_of_tests_run";
if defined $desc {
print " - $desc\n";
} else {
print "\n";
}
return $cond;
}
sub ok($cond, $desc) is export {
proclaim(?$cond, $desc);
}
sub nok($cond, $desc=undef) is export {
proclaim(!$cond, $desc);
}
sub is($x,$y, $desc=undef) is export {
if (!proclaim($x eq $y, $desc)) {
print " GOT: $x\n";
print " EXPECTED: $y\n";
}
}
sub isnt($x,$y, $desc=undef) is export {
if (!proclaim($x ne $y, $desc)) {
print " GOT: $x\n";
print " EXPECTED: $y\n";
t/rakudo/01-sanity/05-sub.t view on Meta::CPAN
#!./blib/script/seis
#
## use v6;
# Checking that testing is sane: subroutines
say '1..4';
sub ok($num) {
say "ok $num";
}
ok(1);
ok 2;
my $counter = 2;
sub ok_auto {
++$counter;
say "ok $counter";
t/spec/roast/S06-other/misc.t view on Meta::CPAN
#! ./blib/script/seis
use v6;
use Test;
plan 3;
#not really much of a test (no links to the spec either). Please improve, I only wrote what was required! --lue
sub a () { my $a=4; }; #zero-arg sub to test the underlying problem #OK not used
eval_dies_ok 'e("wtz")', "e should not be defined to accept arguments";
eval_dies_ok 'pi("wtz")',"pi should not be defined to accept arguments either :) ";
#?pugs todo
dies_ok { eval('a(3)') }, "this should die, no arguments defined";
( run in 3.142 seconds using v1.01-cache-2.11-cpan-524268b4103 )