Skip to content

Commit

Permalink
Merge branch 'master' into glr
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Aug 15, 2015
2 parents 4fabc1e + 9717b4f commit 40d5917
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion S02-types/range.t
Expand Up @@ -274,7 +274,7 @@ lives-ok({"\0".."~"}, "low ascii range completes");
{
for 0,1 -> $i {
throws-like { (^10).bounds[$i] = 1 }, X::Assignment::RO,
typename => 'Int',
typename => / ^ 'Int' | 'value' $ /,
"is Range.bounds[$i] ro";
}
}
Expand Down
7 changes: 6 additions & 1 deletion S04-declarations/implicit-parameter.t
@@ -1,6 +1,6 @@
use v6;
use Test;
plan 19;
plan 20;

# L<S04/The Relationship of Blocks and Declarations/A bare closure
# (except the block associated with a conditional statement)>
Expand Down Expand Up @@ -63,4 +63,9 @@ plan 19;
is $string, 'MooMooMooMooMooMoo', 'outer $_ is seen within nested blocks';
}

# RT #125767
{
is (1.map: { .sqrt => .sqrt }), (1 => 1), 'hash like block with implicit parameter'
}

# vim: ft=perl6
20 changes: 10 additions & 10 deletions S15-literals/numbers.t
Expand Up @@ -5,18 +5,18 @@ use Test;
plan 41;

# basic test of literals
#?rakudo 2 skip "is not a valid number"
#?rakudo.jvm 2 skip "is not a valid number"
is ໑໐, 10, "Can use non-ASCII numbers";
is 10, ໑໐, "Can use non-ASCII numbers";

# expression tests
#?rakudo 3 skip "is not a valid number"
#?rakudo.jvm 3 skip "is not a valid number"
is ٢ * ٤٢, 84, "Non-ASCII numbers can be used in expressions";
is 42 + ٤٢, 84, "Non-ASCII numbers can be mixed with ASCII numbers";
is 42 * 2, ٨٤, "ASCII-only expression can be succesfully compared to non-ASCII number";

# mixed numbers
#?rakudo 2 skip "is not a valid number"
#?rakudo.jvm 2 skip "is not a valid number"
is ᱄2, 42, "Can mix scripts in one number";
is 4᱂, 42, "Can mix scripts in one number";

Expand All @@ -31,31 +31,31 @@ eval-dies-ok("say ⓿", "Numerals in category 'No' not allowed as numeric litera

# binary
is 0b101010, 42, "ASCII binary literals work";
#?rakudo 2 skip "Confused"
#?rakudo.jvm 2 skip "Confused"
is 0b༡༠༡༠༡༠, 42, "Non-ASCII binary literals work";
is 0b༡༠༡010, 42, "Binary literals with a mixture of scripts work";
eval-dies-ok("say 0b¹0", "Numerals in category 'No' can't be used in binary literals");
eval-dies-ok("say 0b1〇", "Numerals in category 'Nl' can't be used in binary literals");

# octal
is 0o755, 493, "ASCII octal literals work";
#?rakudo 2 skip "Confused"
#?rakudo.jvm 2 skip "Confused"
is 0o᠗᠕᠕, 493, "Non-ASCII octal literals work";
is 0o᠗5᠕, 493, "Octal literals with a mixture of scripts work";
eval-dies-ok("say 0o7₅₅", "Numerals in category 'No' can't be used in octal literals");
eval-dies-ok("say 0oⅦ55", "Numerals in category 'Nl' can't be used in octal literals");

# hexadecimal
is 0x42, 66, "ASCII hexadecimal literals work";
#?rakudo 2 skip "Confused"
#?rakudo.jvm 2 skip "Confused"
is 0x๔๒, 66, "Non-ASCII hexadecimal literals work";
is 0x๔2, 66, "Hexadecimal literals with a mixture of scripts work";
eval-dies-ok("say 0x④2", "Numerals in category 'No' can't be used in hexadecimal literals");
eval-dies-ok("say 0x4〢", "Numerals in category 'Nl' can't be used in hexadecimal literals");

is 0xCAFE, 51966, "Uppercase ASCII letters work in hexadecimal literals";
is 0xcafe, 51966, "Lowercase ASCII letters work in hexadecimal literals";
#?rakudo 3 skip "Confused"
#?rakudo.jvm 3 skip "Confused"
is 0xCAFE, 51966, "Uppercase fullwidth letters work in hexadecimal literals";
is 0xcafe, 51966, "Lowercase fullwidth letters work in hexadecimal literals";
is 0xCaFe, 51966, "Valid Hex_Digit characters from different scripts can be mixed in hexadecimal literals";
Expand All @@ -65,14 +65,14 @@ eval-dies-ok("say 0xC𐏓FE", "Numerals in category 'Nl' can't be used in hexade

# generic radices
is :36<Unicodez>, 2402100600299, "ASCII letters work in general radix numbers";
#?rakudo 2 skip "Malformed radix number"
#?rakudo.jvm 2 skip "Malformed radix number"
is :36<Unicodez>, 2402100600299, "Fullwidth letters work in general radix numbers";
is :36<Unicodez>, 2402100600299, "Mixture of ASCII and fullwidth letters work in general radix numbers";
eval-dies-ok("say :36<αω>", "Scripts without Hex_Digit characters not allowed in general radix numbers");

#?rakudo 1 skip "Malformed radix number"
#?rakudo.jvm 1 skip "Malformed radix number"
is :36<utf១៦>, 51760986, "Nd numerals can be used in general radix numbers";
eval-dies-ok("say :36<utfⅧ>", "Nl numerals are not allowed in general radix numbers");
eval-dies-ok("say :36<utf㉜>", "No numerals are not allowed in general radix numbers");

done;
done;

0 comments on commit 40d5917

Please sign in to comment.