Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: nil-assign
Fetching contributors…

Cannot retrieve contributors at this time

file 82 lines (65 sloc) 1.629 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
use v6;
use Test;
# plan *; # This does not test having a real plan.

pass( 'pass($desc)' );

ok 1, 'ok with description';
ok 1;

nok 0, 'nok with description';
nok 0;

is 1, 1, 'is with description';
is 1, 1;

isnt 1, 0, 'isnt with description';
isnt 1, 0;

is_approx 1, 1, 'is_approx with description';
is_approx 1, 1;
# is_approx 1, 1.000001, 'is_approx with small difference';

todo( 'testing todo twice', 2 );
ok 0, 'this should fail, to test todo()';
ok 0, 'this should also fail, to test todo()';
ok 1, 'passing test (todo is done)';

todo( 'todo with no count' );
ok 0, 'todo with no count covers one test';
ok 1, 'passing test (not todo)';

skip( 'skip with reason' );
skip;
skip( 'skip with count and reason', 2 );

# skip_rest();

diag( 'diag works, FYI' );

todo( 'testing flunk', 1 );
flunk( 'flunk' );

{
    my $x = 3;
    isa_ok( $x, Int, 'isa_ok with message' );
    isa_ok( $x, Int );
}

dies_ok { skip( 2, 'reason' ) },
        'skip() dies when given the arguments in the wrong order';

# dies_ok { die }, 'dies_ok';
# dies_ok { die };
#
# lives_ok { 1 }, 'lives_ok';
# lives_ok { 1 };
#
# eval_dies_ok 'die', 'eval_dies_ok';
# eval_dies_ok 'die';
#
# eval_lives_ok '1', 'eval_lives_ok';
# eval_lives_ok '1';
#
# {
# my $deeply = {
# list => (1, 2),
# hash => { a => 1, b => 2 },
# str => 'hello',
# num => 1.2,
# int => 33,
# pair => :a(3),
# undef => undef,
# bool => Bool::True,
# array => [3, 4],
# };
# is_deeply $deeply, $deeply, 'is_deeply';
# is_deeply $deeply, $deeply;
# }

done;

# vim: ft=perl6
Something went wrong with that request. Please try again.