Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Some more kebabcasing test functions
Except is_approx, because it needs special attention?
  • Loading branch information
lizmat committed May 19, 2015
1 parent f17b413 commit 97b4db0
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 47 deletions.
6 changes: 3 additions & 3 deletions t/01-sanity/52-parse-include-spec.t
Expand Up @@ -28,7 +28,7 @@ for (

) -> $to-check { parse_ok( $to-check ) };

dies_ok { CompUnitRepo.parse-spec('CompUnitRepo::GitHub#masak/html-template') },
dies-ok { CompUnitRepo.parse-spec('CompUnitRepo::GitHub#masak/html-template') },
"must have module loaded";

# need EVAL to create and check class at runtime
Expand All @@ -44,7 +44,7 @@ for (
) -> $to-check { parse_ok( $to-check ) };
';

is_deeply @*INC, PARSE-INCLUDE-SPECS(CREATE-INCLUDE-SPECS(@*INC)),
is-deeply @*INC, PARSE-INCLUDE-SPECS(CREATE-INCLUDE-SPECS(@*INC)),
'can we reproduce an @*INC setting';

#========================================================
Expand All @@ -53,5 +53,5 @@ sub parse_ok ($to-check) {
my $answers := $to-check.value;

my $result = PARSE-INCLUDE-SPECS($checking);
is_deeply $result, $answers, "'$checking' returned the right thing";
is-deeply $result, $answers, "'$checking' returned the right thing";
}
6 changes: 3 additions & 3 deletions t/01-sanity/54-use-lib.t
Expand Up @@ -27,13 +27,13 @@ is (BEGIN @?INC[0]), 'file#bar', 'did we revert to previous setting';
is (BEGIN @?INC[1]), 'file#foo', 'do we have previous entry moved down again';
is (BEGIN +@?INC), $start + 2, 'did we revert number of elements';

throws_like( { @?INC[0] = "boom" },
throws-like( { @?INC[0] = "boom" },
X::Assignment::RO,
typename => 'Str',
);
for <unshift("boom") push("boom")> -> $method {
throws_like( "@?INC.$method", X::Multi::NoMatch );
throws-like( "@?INC.$method", X::Multi::NoMatch );
}
for <shift pop> -> $method {
throws_like( "@?INC.$method", X::Method::NotFound );
throws-like( "@?INC.$method", X::Method::NotFound );
}
76 changes: 38 additions & 38 deletions t/01-sanity/99-test-basic.t
Expand Up @@ -73,7 +73,7 @@ skip( 'skip with reason' );
skip;
skip( 'skip with count and reason', 2 );

# skip_rest();
# skip-rest();

diag( 'diag works, FYI' );

Expand All @@ -82,54 +82,54 @@ flunk( 'flunk' );

{
my $x = 3;
my $isa1 = isa_ok( $x, Int, 'isa_ok with message' );
ok $isa1, 'isa_ok returns True';
isa_ok( $x, Int );
my $isa1 = isa-ok( $x, Int, 'isa-ok with message' );
ok $isa1, 'isa-ok returns True';
isa-ok( $x, Int );

# NOT_TODO
todo( 'failing isa_ok returns False' );
my $isa2 = isa_ok( 'abc', Int );
nok $isa2, 'Failing isa_ok returns False';
todo( 'failing isa-ok returns False' );
my $isa2 = isa-ok( 'abc', Int );
nok $isa2, 'Failing isa-ok returns False';
}

my $dies_ok1 = dies_ok { skip( 2, 'reason' ) },
my $dies-ok1 = dies-ok { skip( 2, 'reason' ) },
'skip() dies when given the arguments in the wrong order';
ok $dies_ok1, 'dies_ok returns True';
ok $dies-ok1, 'dies-ok returns True';

# NOT_TODO
todo( 'failing dies_ok returns False' );
my $dies_ok2 = dies_ok { 1 }, 'dies_ok {1}';
nok $dies_ok2, 'dies_ok returns False if code did not die';
todo( 'failing dies-ok returns False' );
my $dies-ok2 = dies-ok { 1 }, 'dies-ok {1}';
nok $dies-ok2, 'dies-ok returns False if code did not die';

dies_ok { die }, 'dies_ok';
dies_ok { die };
dies-ok { die }, 'dies-ok';
dies-ok { die };

my $lives_ok1 = lives_ok { 1 }, 'lives_ok';
ok $lives_ok1, 'lives_ok returns True';
lives_ok { 1 };
my $lives_ok1 = lives-ok { 1 }, 'lives_ok';
ok $lives_ok1, 'lives-ok returns True';
lives-ok { 1 };

# NOT_TODO
todo( 'failing lives_ok returns False' );
my $lives_ok2 = lives_ok { die }, 'lives_ok { die }';
nok $lives_ok2, 'failing lives_ok returns False';
todo( 'failing lives-ok returns False' );
my $lives-ok2 = lives-ok { die }, 'lives-ok { die }';
nok $lives-ok2, 'failing lives-ok returns False';

my $ed_ok1 = eval_dies_ok 'die', 'eval_dies_ok';
ok $ed_ok1, 'eavl_dies_ok returns True';
eval_dies_ok 'die';
my $ed-ok1 = eval-dies-ok 'die', 'eval-dies-ok';
ok $ed-ok1, 'eavl-dies-ok returns True';
eval-dies-ok 'die';

# NOT_TODO
todo( 'eval_dies_ok 1 returns False' );
my $ed_ok2 = eval_dies_ok '1', 'eval_dies_ok 1 fails';
nok $ed_ok2, 'eval_dies_ok 1 returns False';
todo( 'eval-dies-ok 1 returns False' );
my $ed-ok2 = eval-dies-ok '1', 'eval-dies-ok 1 fails';
nok $ed-ok2, 'eval-dies-ok 1 returns False';

my $el_ok1 = eval_lives_ok '1', 'eval_lives_ok';
ok $el_ok1, 'eval_lives_ok 1 returns True';
eval_lives_ok '1';
my $el-ok1 = eval-lives-ok '1', 'eval-lives-ok';
ok $el-ok1, 'eval-lives-ok 1 returns True';
eval-lives-ok '1';

# NOT_TODO
todo( 'failing eval_lives_ok returns False' );
my $el_ok2 = eval_lives_ok 'die', 'lives_ok { die }';
nok $el_ok2, 'failing eval_lives_ok returns False';
todo( 'failing eval-lives-ok returns False' );
my $el-ok2 = eval-lives-ok 'die', 'lives-ok { die }';
nok $el-ok2, 'failing eval-lives-ok returns False';

{
my $deeply = {
Expand All @@ -143,15 +143,15 @@ nok $el_ok2, 'failing eval_lives_ok returns False';
bool => Bool::True,
array => [3, 4],
};
my $is_deeply = is_deeply $deeply, $deeply, 'is_deeply';
ok $is_deeply, 'is_deeply returns True';
is_deeply $deeply, $deeply;
my $is-deeply = is-deeply $deeply, $deeply, 'is-deeply';
ok $is-deeply, 'is-deeply returns True';
is-deeply $deeply, $deeply;
}

# NOT_TODO
todo( 'failing is_deeply returns False' );
my $is_deeply = is_deeply {a => 1}, {}, 'is_deeply with exta key fails';
nok $is_deeply, 'failing is_deeply returns False';
todo( 'failing is-deeply returns False' );
my $is-deeply = is-deeply {a => 1}, {}, 'is-deeply with exta key fails';
nok $is-deeply, 'failing is-deeply returns False';

done;

Expand Down
4 changes: 2 additions & 2 deletions t/04-nativecall/04-pointers.t
Expand Up @@ -30,7 +30,7 @@ ok ReturnNullPointer().defined == False, 'A returned NULL pointer is the Po
ok ReturnNullPointer().Bool == False, 'A returned NULL pointer is the Pointer type object itself';

{
eval_lives_ok q:to 'CODE', 'Signature matching with Pointer[Int] works (RT #124321)';
eval-lives-ok q:to 'CODE', 'Signature matching with Pointer[Int] works (RT #124321)';
use NativeCall;
sub TakeTwoPointersToInt( Pointer[Int], Pointer[Int] )
Expand All @@ -44,7 +44,7 @@ ok ReturnNullPointer().Bool == False, 'A returned NULL pointer is the Po
}
{
eval_lives_ok q:to 'CODE', 'Signature matching with CArray[Int] works';
eval-lives-ok q:to 'CODE', 'Signature matching with CArray[Int] works';
use NativeCall;

sub TakeCArrayToInt8( CArray[int8] )
Expand Down
2 changes: 1 addition & 1 deletion t/04-nativecall/05-arrays.t
Expand Up @@ -72,7 +72,7 @@ compile_test_lib('05-arrays');
@arr[1].set(11);
@arr[2].set(13);

is_deeply @arr[100], Struct, 'out-of-bounds access on managed array';
is-deeply @arr[100], Struct, 'out-of-bounds access on managed array';

is TakeAStructArray(@arr), 14, 'struct in position 0..2, C-side';
}
Expand Down

0 comments on commit 97b4db0

Please sign in to comment.