Skip to content

Commit

Permalink
Tests for Unicode digits in various places
Browse files Browse the repository at this point in the history
E.g., radix bases, match variables, and type constraints
Tests for RT #129279
  • Loading branch information
MasterDuke17 committed Sep 16, 2016
1 parent 7738e43 commit 968764e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
8 changes: 7 additions & 1 deletion S02-literals/radix.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 154;
plan 155;

# L<S02/General radices/":10<42>">
is( :10<0>, 0, 'got the correct int value from decimal 0' );
Expand Down Expand Up @@ -287,4 +287,10 @@ for 2..36 {
throws-like { EVAL ':2' }, X::Syntax::Malformed, ':2 is Malformed';
}

# RT #129279
{
lives-ok
{ :۳<12> },
'Unicode digit radix bases work';
}
# vim: ft=perl6
8 changes: 7 additions & 1 deletion S05-match/capturing-contexts.t
Expand Up @@ -5,7 +5,7 @@ use MONKEY-TYPING;

use Test;
use Test::Util;
plan 59;
plan 60;

# old: L<S05/Return values from matches/"A match always returns a Match object" >
# L<S05/Match objects/"A match always returns a " >
Expand Down Expand Up @@ -249,4 +249,10 @@ plan 59;
'non-ascii token in a subcapture work';
}

# RT #129279
{
lives-ok
{ "a b" ~~ /(\w) \s (\w)/; my $a = $١ },
'Unicode digit match variables work';
}
# vim: ft=perl6
8 changes: 7 additions & 1 deletion S06-signature/types.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 12;
plan 13;

sub f($x) returns Int { return $x };

Expand Down Expand Up @@ -46,4 +46,10 @@ dies-ok { g('m') }, 'type check forbids bad implicit return';
'type shown in the exception message is the right one';
}

# RT #129279
{
lives-ok
{ sub f(-١) { 2 }; f(-1) },
'Unicode digit negative type constraints work';
}
# vim: ft=perl6

0 comments on commit 968764e

Please sign in to comment.