Skip to content

Commit

Permalink
Remove trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Oct 15, 2018
1 parent 77949f4 commit 963b08f
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions S29-any/isa.t
Expand Up @@ -2,12 +2,12 @@ use v6;

use Test;

=begin kwid
=begin kwid
.isa() tests
These tests are specific to the .isa() which is attached to the
Perl6 Array "class". Which is actually @array.HOW.isa(), which
Perl6 Array "class". Which is actually @array.HOW.isa(), which
is actually just the normal OO .isa(). This test does not attempt
to test anything other than the "normal" behavior of @array.isa()
Expand All @@ -16,43 +16,43 @@ Further clarification of .isa() can be found here:
L<"http://www.nntp.perl.org/group/perl.perl6.language/20974">
L<S29/Any/=item isa/>
=end kwid
=end kwid

plan 12;
plan 11;

{ # invocant notation
{ # invocant notation
my @arr = <1 2 3 4>;

ok(@arr.isa(Array), '... @arr is-a Array (invocant notation)');

# check a failing case
ok(!@arr.isa(Hash), '... @arr is-not-a Hash (invocant notation)');
}


{ # invocant notation
{ # invocant notation
my $arr_ref = <1 2 3 4>;

# check a failing case
nok($arr_ref.isa(Hash), '... $arr is-not-a Hash (invocant notation)');
nok($arr_ref.isa(Hash), '... $arr is-not-a Hash (invocant notation)');
}

# check error cases

{
my @arr = <1 2 3 4>;
throws-like 'isa(@arr, Array)', X::Undeclared::Symbols, 'no sub called isa()';
dies-ok { @arr.isa() }, '... isa() with a single arg is a failing case (invocant notation)';
dies-ok { @arr.isa(Array, Hash) }, '... isa() with a extra args is a failing case (invocant notation)';
dies-ok { @arr.isa() }, '... isa() with a single arg is a failing case (invocant notation)';

dies-ok { @arr.isa(Array, Hash) }, '... isa() with a extra args is a failing case (invocant notation)';
}

## some edge cases, and weirdness

{ # check .isa() on inline values

ok([1, 2, 3, 4].isa(Array), '... [1, 2, 3, 4].isa("Array") works');
ok(![1, 2, 3, 4].isa(Hash), '... [1, 2, 3, 4].isa("Hash") fail predicably');
ok(![1, 2, 3, 4].isa(Hash), '... [1, 2, 3, 4].isa("Hash") fail predicably');
}

class Thing {};
Expand Down

0 comments on commit 963b08f

Please sign in to comment.