Skip to content

Commit

Permalink
Merge pull request #463 from ribbon-otter/issue2094
Browse files Browse the repository at this point in the history
Check .:< ... > for prefix operators on int literals
  • Loading branch information
lizmat committed Sep 2, 2018
2 parents 0c7bbba + 4947054 commit adc2330
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion S02-literals/numeric.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 67;
plan 68;

isa-ok 1, Int, '1 produces a Int';
does-ok 1, Numeric, '1 does Numeric';
Expand Down Expand Up @@ -121,4 +121,15 @@ ok 0e999999999999999 == 0, '0e999999999999 equals zero';
is ∞, Inf, "yeah, we do that too...";
}


# https://github.com/rakudo/rakudo/issues/2094
subtest '#2094 prefix as post fix works on number literals' => {
plan 6;
eval-lives-ok q{42.:<-> == -42}, 'use negation as postfix';
eval-lives-ok q{42.:<~> === "42"}, 'use ~ as postfix';
eval-lives-ok q{42.:«~» === "42"}, 'use « » to wrap the prefix';
eval-lives-ok q{42.:<<~>> === "42"}, 'use << >> to wrap the prefix';
eval-lives-ok q{42.:["~"] === "42"}, 'use [" "] to wrap the prefix';
eval-lives-ok q{42.:<<'~'>> === "42"}, "use <<' '>> to wrap the prefix";
}
# vim: ft=perl6 sw=4 ts=4 expandtab

0 comments on commit adc2330

Please sign in to comment.