Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'glr' of https://github.com/perl6/roast into glr
  • Loading branch information
dwarring committed Aug 26, 2015
2 parents e3d35a1 + c5b4ed9 commit c1ab404
Show file tree
Hide file tree
Showing 35 changed files with 785 additions and 461 deletions.
1 change: 0 additions & 1 deletion S02-magicals/UsedEnv.pm6
Expand Up @@ -2,6 +2,5 @@ module UsedEnv {
use Test;
plan 1;
ok (%*ENV<PATH>:exists or %*ENV<HOMEPATH>:exists), "env exists in use (RT #78258)";
done;
}

8 changes: 4 additions & 4 deletions S02-names-vars/names.t
Expand Up @@ -9,7 +9,6 @@ plan 144;
# L<S02/Names/>
# syn r14552

#?rakudo skip 'package variable autovivification RT #124637'
#?niecza skip 'Undeclared name: Terrain::'
{
my $mountain = 'Hill';
Expand All @@ -18,8 +17,10 @@ plan 144;
our $river = 'Terrain::Hill';
is($mountain, 'Hill', 'basic variable name');
is($Terrain::mountain, 108, 'variable name with package');
#?rakudo skip 'package variable autovivification RT #124637'
is(Terrain::<$mountain>, 108, 'variable name with sigil not in front of package');
is($Terrain::Hill::mountain, 1024, 'variable name with 2 deep package');
#?rakudo skip 'package variable autovivification RT #124637'
is(Terrain::Hill::<$mountain>, 1024, 'varaible name with sigil not in front of 2 package levels deep');
is($Terrain::($mountain)::mountain, 1024, 'variable name with a package name partially given by a variable ');
is($::($river)::mountain, 1024, 'variable name with package name completely given by variable');
Expand All @@ -29,11 +30,11 @@ plan 144;
my $bear = 2.16;
is($bear, 2.16, 'simple variable lookup');
#?niecza skip 'Object reference not set to an instance of an object'
#?rakudo skip 'this kind of lookup NYI'
#?rakudo skip 'this kind of lookup NYI RT #125659'
is($::{'bear'}, 2.16, 'variable lookup using $::{\'foo\'}');
is(::{'$bear'}, 2.16, 'variable lookup using ::{\'$foo\'}');
#?niecza skip 'Object reference not set to an instance of an object'
#?rakudo skip 'this kind of lookup NYI'
#?rakudo skip 'this kind of lookup NYI RT #125659'
is($::<bear>, 2.16, 'variable lookup using $::<foo>');
is(::<$bear>, 2.16, 'variable lookup using ::<$foo>');
}
Expand All @@ -46,7 +47,6 @@ plan 144;
is(::{'$!@#$'}, 2.22, 'variable lookup using ::{\'$symbols\'}');
is($::<!@#$>, 2.22, 'variable lookup using $::<symbols>');
is(::<$!@#$>, 2.22, 'variable lookup using ::<$symbols>');

}

# RT #65138, Foo::_foo() parsefails
Expand Down
2 changes: 1 addition & 1 deletion S02-names-vars/variables-and-packages.t
Expand Up @@ -166,7 +166,7 @@ plan 38;
my @array;
for 1..3 {
@array.push($i);
my $i = 1 + $i;
my $i = 1;
}
};
s(9);/ },
Expand Down
8 changes: 4 additions & 4 deletions S02-types/declare.t
Expand Up @@ -4,7 +4,7 @@ use Test;
# see if you can declare the various built-in types
# a broad but not in depth test of the existence of various types

plan 71;
plan 70;

# L<S02/"Built-in Type Conventions"/"Built-in object types start with an uppercase letter">

Expand Down Expand Up @@ -113,9 +113,9 @@ plan 71;
# Non-object (native) types are lowercase: int, num, complex, rat, buf, bit.

{
my int $namcu; $namcu = 2**100;
isa-ok $namcu, Int, "int reports as Int";
ok $namcu==0, "Can tell it's an int because it overflowed";
throws-like { my int $namcu; $namcu = 2**100 }, X::AdHoc,
message => 'Cannot unbox 101 bit wide bigint into native integer',
"Assign big bigint to native won't overflow silently";
}

{
Expand Down
2 changes: 1 addition & 1 deletion S03-metaops/hyper.t
Expand Up @@ -701,7 +701,7 @@ my @e;

# test non-UTF-8 input
#?niecza skip 'nonsensical test'
#?rakudo skip 'EVAL(Buf) RT #124514'
#?rakudo skip 'EVAL(Buf) RT #122256'
#?DOES 1
{
my $t = '(1, 2, 3) »+« (4, 3, 2)';
Expand Down
7 changes: 2 additions & 5 deletions S04-declarations/my.t
Expand Up @@ -159,11 +159,8 @@ is(EVAL('loop (my $x = 1, my $y = 2; $x > 0; $x--) { last }; $y #OK'), 2, '2nd m
is($f, 5, "two lexicals declared in scope is noop");
}

my $z = 42; #OK not used
{
my $z = $z;
nok( $z.defined, 'my $z = $z; can not see the value of the outer $z');
}
# RT #125371
throws-like 'my $z = $z', X::Syntax::Variable::Initializer, name => '$z';

# interaction of my and EVAL
# yes, it's weird... but that's the way it is
Expand Down
8 changes: 1 addition & 7 deletions S04-declarations/our.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 32;
plan 31;

# L<S04/The Relationship of Blocks and Declarations/"our $foo" introduces a lexically scoped alias>
our $a = 1;
Expand Down Expand Up @@ -31,12 +31,6 @@ is($a, 3, '$a has changed'); # XXX is that right?
is ~@b, '3', 'push actually worked on @b';
}

our $c = 42; #OK not used
{
my $c = $c;
nok( $c.defined, 'my $c = $c; can not see the value of the outer $c');
}

# check that our-scoped variables really belong to the package
{
package D1 {
Expand Down
8 changes: 7 additions & 1 deletion S05-metasyntax/charset.t
Expand Up @@ -12,7 +12,7 @@ be valid perl6.
=end pod

plan 41;
plan 42;

# Broken:
# L<S05/Extensible metasyntax (C<< <...> >>)/"A leading [ ">
Expand Down Expand Up @@ -93,4 +93,10 @@ nok '^' ~~ / <[ \[ .. \] ]> /, '... does not match outside its range';
ok 'z' ~~ / <[a..z]-[x]> /, '... but others are fine';
}

# RT #120511
{
is "\r\na" ~~ /<?[\n]>"\r\na"/, "\r\na",
'look-ahead with windows newline does not advance cursor position';
}

# vim: ft=perl6
2 changes: 0 additions & 2 deletions S06-other/main-usage.t
Expand Up @@ -169,7 +169,6 @@ is_run 'sub MAIN() { print 42 }',
'superfluous options trigger usage message';

# RT #115744
#?rakudo todo 'RT #115744'
#?niecza todo
is_run 'sub MAIN($arg) { print $arg }',
{
Expand All @@ -178,7 +177,6 @@ is_run 'sub MAIN($arg) { print $arg }',
:args['--', '--23'],
'Stopping option processing';

#?rakudo todo 'RT #115744'
#?niecza todo
is_run 'sub MAIN($arg, Bool :$bool) { print $bool, $arg }',
{
Expand Down
2 changes: 1 addition & 1 deletion S14-roles/mixin.t
Expand Up @@ -128,7 +128,7 @@ is $y.test, 42, 'method from other role was OK too';
my $rt115390 = 0;
for 1..1000 -> $i {
$rt115390 += $i.perl;
my $error = (my $val = (^10).pick(3).min but !$val);
my $error = (my $val = (^10).pick(3).min but !$rt115390);
1
}
is $rt115390, 500500,
Expand Down
2 changes: 0 additions & 2 deletions S15-literals/identifiers.t
Expand Up @@ -31,5 +31,3 @@ my $fi = False;

is $fi, False, "Identifiers are not put through compatability decomposition";
is $, True, "Identifiers are not put through compatability decomposition";

done;
2 changes: 0 additions & 2 deletions S15-literals/numbers.t
Expand Up @@ -74,5 +74,3 @@ eval-dies-ok("say :36<αω>", "Scripts without Hex_Digit characters not allowed
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;

0 comments on commit c1ab404

Please sign in to comment.