Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' of https://github.com/perl6/roast
  • Loading branch information
dwarring committed Oct 26, 2014
2 parents cb97064 + 7f81801 commit ee9b239
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 8 deletions.
10 changes: 9 additions & 1 deletion S02-types/native.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 27;
plan 29;

{
my int $x;
Expand Down Expand Up @@ -102,4 +102,12 @@ plan 27;
is $x.WHAT, int, 'is it really a native';
}

# RT #121349
{
my @j;
my int $j = 42;
lives_ok { @j.push($j) }, 'can push native int to an array (1)';
is @j[0], 42, 'can push native int to an array (2)';
}

# vim: ft=perl6
8 changes: 7 additions & 1 deletion S05-metasyntax/unknown.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 11;
plan 12;

# L<S05/Simplified lexical parsing of patterns/not all non-identifier glyphs are currently meaningful as metasyntax>

Expand Down Expand Up @@ -36,6 +36,12 @@ lives_ok({"aa!" ~~ /'a'/}, 'quoted "a" is valid');
throws_like '$_ = "0"; s/-/1/', X::Syntax::Regex::UnrecognizedMetachar, metachar => '-';
}

# RT #77562
# not sure this is the right place for this test
{
lives_ok { /$'x'/ }, 'can parse /$\'x\'/';
}

done;

# vim: ft=perl6
9 changes: 8 additions & 1 deletion S10-packages/basic.t
Expand Up @@ -4,7 +4,7 @@ use v6;

use Test;

plan 62;
plan 63;

my regex fairly_conclusive_platform_error {:i ^\N* <<Null?>>}

Expand Down Expand Up @@ -276,4 +276,11 @@ eval_dies_ok q[
'autovivification works with nested "use" directives (import from two nested files)';
}

# RT #120561
#?rakudo.parrot skip 'RT #120561'
{
lives_ok { use lib "{$?FILE.path.directory}/t/spec/packages" },
'no Null PMC access with "use lib $double_quoted_string"';
}

# vim: ft=perl6
14 changes: 13 additions & 1 deletion S12-attributes/class.t
Expand Up @@ -11,7 +11,7 @@ Class Attributes
#L<S12/Class attributes/"Class attributes are declared">
#L<S12/Class methods/Such a metaclass method is always delegated>

plan 27;
plan 29;

class Foo {
our $.bar = 23;
Expand Down Expand Up @@ -143,4 +143,16 @@ dies_ok {$test5 = Quux.bar}, 'class attribute accessor hidden by accessor in sub
is B.new.b, 2;
}

# RT #102478
{
class RT102478_1 { BEGIN EVAL q[has $.x] };
is RT102478_1.new(x => 3).x, 3,
'can declare attribute inside of a BEGIN EVAL in class';

class RT102478_2 { EVAL q[has $.x] };
throws_like { RT102478_2.new(x => 3).x },
X::Method::NotFound,
'cannot declare attribute inside of an EVAL in class';
}

# vim: ft=perl6
9 changes: 8 additions & 1 deletion S12-attributes/undeclared.t
Expand Up @@ -8,7 +8,7 @@ use Test;
=end pod

plan 10;
plan 11;


dies_ok { class A { method set_a { $.a = 1 }}; A.new.set_a; },
Expand Down Expand Up @@ -39,4 +39,11 @@ eval_dies_ok ' role R { method r { $!r := 1 }};class S does R { }; S.new.r; ',
eval_dies_ok ' class T { method t { $!t := 1 }}; ::T.new.t; ',
"Test Undeclared private attribute binding from a class";

# RT #102478
{
throws_like { EVAL q[has $.x] },
X::Attribute::NoPackage,
message => q[You cannot declare attribute '$.x' here; maybe you'd like a class or a role?];
}

# vim: ft=perl6
5 changes: 2 additions & 3 deletions S32-str/sprintf.t
Expand Up @@ -240,11 +240,10 @@ is Date.new(-13_000_000_000, 1, 1), '-13000000000-01-01

# RT #116280
#?rakudo.jvm skip "java.lang.NumberFormatException: RT#116280"
#?rakudo.moar todo 'RT #116280'
#?rakudo.moar todo 'RT #116280 -- sprintf prints numbers instead of NaN/inf/-inf'
#?rakudo.parrot todo 'RT #116280 -- sprintf prints numbers instead of NaN/inf/-inf'
{
#?rakudo.parrot todo 'sprintf prints numbers before NaN'
is sprintf('%12.5f', NaN), ' NaN', 'RT #116280';
#?rakudo.parrot 2 skip "sprintf hangs when printing Inf/-Inf"
#?niecza 2 todo "https://github.com/sorear/niecza/issues/181"
is sprintf('%12.5f', Inf), ' inf', 'RT #116280';
is sprintf('%12.5f', -Inf), ' -inf', 'RT #116280';
Expand Down

0 comments on commit ee9b239

Please sign in to comment.