Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
check revised semantics for Whatever vs ~~
  • Loading branch information
TimToady committed Apr 6, 2015
1 parent 008b78c commit 4faae07
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 6 additions & 1 deletion S02-types/whatever.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 87;
plan 89;

# L<S02/The Whatever Object/"The * character as a standalone term captures the notion of">
# L<S02/Native types/"If any native type is explicitly initialized to">
Expand Down Expand Up @@ -278,4 +278,9 @@ eval_dies_ok '{*.{}}()', '{*.{}}() dies';
isa_ok (*.{1}), Code, '*.{1} is some kind of code';
}

{
isa_ok Whatever eqv 42, Bool, "Whatever type object does not autoprime";
isa_ok WhateverCode eqv 42, Bool, "WhateverCode type object does not autoprime";
}

# vim: ft=perl6
7 changes: 4 additions & 3 deletions S03-smartmatch/disorganized.t
@@ -1,6 +1,6 @@
use v6;
use Test;
plan 41;
plan 42;

=begin pod
Expand Down Expand Up @@ -138,8 +138,9 @@ eval_lives_ok 'class A { method foo { return "" ~~ * } }; A.new.foo',
nok RT72048_class.new !~~ RT72048_role, 'class instance !!matches role';
}

ok "foo" ~~ *, 'thing ~~ * is true';
ok ("foo" ~~ *) ~~ Bool, 'thing ~~ * is a boolean';
ok ("foo" ~~ *) ~~ WhateverCode, 'thing ~~ * autoprimes';
ok ("foo" ~~ *.chars == 3) ~~ Bool, 'thing ~~ WhateverCode is a boolean';
ok ?(* ~~ "foo")('foo'), '* ~~ "foo" is WhateverCode';

done();

Expand Down

0 comments on commit 4faae07

Please sign in to comment.