Skip to content

Commit

Permalink
niecza fudging
Browse files Browse the repository at this point in the history
  • Loading branch information
coke committed Sep 28, 2011
1 parent 6737bd0 commit 6a6cd4f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
6 changes: 6 additions & 0 deletions S02-lexical-conventions/comments.t
Expand Up @@ -59,6 +59,7 @@ plan 46;
}

# L<S02/"Embedded Comments"/"no space" between "#" and bracket>
#?niecza skip 'Opening bracket is required for #` comment'
{

ok !eval("3 * #` (invalid comment) 2"), "no space allowed between '#`' and '('";
Expand Down Expand Up @@ -99,6 +100,7 @@ plan 46;
# I am not sure if this is speced somewhere:
# comments can be nested
#?rakudo skip 'nested brackets'
#?niecza skip 'Possible runaway string'
{
is 3, #`(
comment
Expand Down Expand Up @@ -140,6 +142,7 @@ plan 46;

# L<S02/"Literals"/"# at beginning of line is always a line-end comment">
{
#?niecza skip 'TODO'
eval_dies_ok "#<this is a comment\n'abc'",
'#+bracket at start of line is an error';

Expand All @@ -148,6 +151,7 @@ plan 46;
}

# L<S02/Comments in Unspaces and vice versa/"comment may not contain an unspace">
#?niecza skip 'Excess arguments to CORE eval'
{
my $a;
ok !eval '$a = #`\ (comment) 32', "comments can't contain unspace";
Expand All @@ -156,6 +160,7 @@ plan 46;

# L<S02/Single-line Comments/"# may not be used as"
# delimiter quoting>
#?niecza skip 'System.IndexOutOfRangeException: Array index is out of range.'
{
my $a;
ok eval('$a = q{ 32 }'), 'sanity check';
Expand All @@ -167,6 +172,7 @@ plan 46;
}

# L<S02/Single-line Comments/"single-line comments">
#?niecza skip 'TODO'
{
# ticket http://rt.perl.org/rt3/Ticket/Display.html?id=70752
eval_lives_ok "#=======\n#=======\nuse v6;", "pragma use after single line comments";
Expand Down
8 changes: 8 additions & 0 deletions S02-literals/quoting.t
Expand Up @@ -232,6 +232,7 @@ Note that non-ASCII tests are kept in quoting-unicode.t
};
#?rakudo skip 'quoting with adverbs'
#?niecza skip 'TODO'
{ # qq:ww, interpolating L<S02/Literals/double angles do interpolate>
# L<S02/Forcing item context/"implicit split" "shell-like fashion">
my (@q1, @q2, @q3, @q4) = ();
Expand Down Expand Up @@ -261,6 +262,7 @@ Note that non-ASCII tests are kept in quoting-unicode.t
}
#?rakudo skip '«...»'
#?niecza skip 'TODO'
{
#L<S02/Forcing item context/"relationship" "single quotes" "double angles">
# Pugs was having trouble with this. Fixed in r12785.
Expand All @@ -281,6 +283,7 @@ Note that non-ASCII tests are kept in quoting-unicode.t
is(@q1[3], "BAR", '$bar was interpolated');
@q2 = «$foo "$gorch" '$bar'»;
#?niecza 3 skip 'TODO'
is(+@q2, 3, "3 elementes in sub quoted «» list");
is(@q2[1], $gorch, 'second element is both parts of $gorch, interpolated');
is(@q2[2], '$bar', 'single quoted $bar was not interpolated');
Expand Down Expand Up @@ -341,18 +344,22 @@ FOO
# <<:Pair>>
my @q = <<:p(1)>>;
#?rakudo 2 todo '<< :pair(1) >> (RT 65304)'
#?niecza skip 'TODO'
is(@q[0].perl, (:p(1)).perl, "pair inside <<>>-quotes - simple");
@q = <<:p(1) junk>>;
#?niecza skip 'TODO'
is(@q[0].perl, (:p(1)).perl, "pair inside <<>>-quotes - with some junk");
is(@q[1], 'junk', "pair inside <<>>-quotes - junk preserved");
@q = <<:def>>;
#?rakudo 2 todo '<< :pair(1) >>'
#?niecza skip 'TODO'
is(@q[0].perl, (def => 1).perl, ":pair in <<>>-quotes with no explicit value");
@q = "(eval failed)";
try { eval '@q = <<:p<moose>>>;' };
#?niecza skip 'TODO'
is(@q[0].perl, (p => "moose").perl, ":pair<anglequoted>");
};
Expand Down Expand Up @@ -466,6 +473,7 @@ Hello, World
# L<S02/Adverbs on quotes/"Interpolate % vars">
# q:h
#?rakudo skip 'quoting adverbs'
#?niecza skip 'TODO'
{
# Pugs can't parse q:h currently.
my %t = (a => "perl", b => "rocks");
Expand Down
13 changes: 8 additions & 5 deletions S02-types/hash.t
Expand Up @@ -60,6 +60,7 @@ ok(%hash5.does(Hash), '%hash5 does Hash');
is(@slice2[1], 1, '%hash<> slice was successful');
}

#?niecza skip 'TODO'
{
my @slice3 = %hash5<>.sort;
is(+@slice3, 3, 'empty slice got all hash values');
Expand Down Expand Up @@ -173,7 +174,6 @@ test2 %h;
# 20060604: Now that defaulting works the other way around, hashes resume
# the bias-to-the-right behaviour, consistent with Perl 5.
#
#?DOES 4

my %dupl = (a => 1, b => 2, a => 3);
is %dupl<a>, 3, "hash creation with duplicate keys works correctly";
Expand All @@ -190,14 +190,17 @@ is %dupl<a>, 3, "hash creation with duplicate keys works correctly";
is $i, 4, "for %hash works";
}

eval ' @%(a => <b>)<a> ';
ok( $!, "doesn't really make sense, but shouldn't segfault, either ($!)");
#?niecza skip 'Non-declarative sigil is missing its name'
{
eval ' @%(a => <b>)<a> ';
ok( $!, "doesn't really make sense, but shouldn't segfault, either ($!)");
}

# test for RT #62730
#?niecza skip 'TODO'
lives_ok { Hash.new("a" => "b") }, 'Hash.new($pair) lives';

# RT #71022
#?DOES 1
{
my %rt71022;
%rt71022<bughunt> = %rt71022<bughunt>;
Expand Down Expand Up @@ -237,7 +240,6 @@ lives_ok { Hash.new("a" => "b") }, 'Hash.new($pair) lives';
# By collective knowledge of #perl6 and @larry, .{ } is actually defined in
# Any
#?rakudo skip 'RT 58372'
#?DOES 3
{
my $x;
lives_ok { $x{'a'} }, 'can index a variable that defaults to Any';
Expand All @@ -246,6 +248,7 @@ lives_ok { Hash.new("a" => "b") }, 'Hash.new($pair) lives';
}

# Zen slices work on hashes too
#?niecza skip 'Use of uninitialized value in string context'
{
my %h = { a => 1, b => 2, c => 3};
is %h{*}.join('|'), %h.values.join('|'), '{*} zen slice';
Expand Down
6 changes: 6 additions & 0 deletions S02-types/infinity.t
Expand Up @@ -8,26 +8,30 @@ plan 13;
my $x = Inf;

ok( $x == Inf , 'numeric equal');
#?niecza skip 'TODO'
ok( $x eq 'Inf', 'string equal');
}

{
my $x = -Inf;
ok( $x == -Inf, 'negative numeric equal' );
#?niecza skip 'TODO'
ok( $x eq '-Inf', 'negative string equal' );
}

#?rakudo todo 'integer Inf'
{
my $x = Inf.Int;
ok( $x == Inf, 'int numeric equal' );
#?niecza skip 'TODO'
ok( $x eq 'Inf', 'int string equal' );
}

#?rakudo todo 'integer Inf'
{
my $x = ( -Inf ).Int;
ok( $x == -Inf, 'int numeric equal' );
#?niecza skip 'TODO'
ok( $x eq '-Inf', 'int string equal' );
}

Expand All @@ -41,11 +45,13 @@ plan 13;

ok truncate(Inf) ~~ Inf, 'truncate(Inf) ~~ Inf';
#?rakudo 3 todo 'Int conversion of NaN and Inf'
#?niecza 3 skip 'TODO'
ok NaN.Int === NaN, 'Inf.Int === Int';
ok Inf.Int === Inf, 'Inf.Int === Int';
ok (-Inf).Int === (-Inf), 'Inf.Int === Int';

# RT #70730
#?niecza skip 'TODO'
{
ok ( rand * Inf ) === Inf, 'multiply rand by Inf without maximum recursion depth exceeded';
}
Expand Down
1 change: 1 addition & 0 deletions S02-types/parcel.t
Expand Up @@ -15,6 +15,7 @@ is +<5 7 8>, 3, 'prefix:<+> on an angle bracket Parcel';
is ~<5 7 8>, '5 7 8', 'prefix:<~> on an angle bracket Parcel';
is <5 7 8>.Str, '5 7 8', '.Str on an angle bracket Parcel';

#?niecza 3 skip 'Unable to resolve method Array in class Parcel'
isa_ok (5, 7, 8).Array, Array, '.Array returns an array';
is (5, 7, 8).Array, [5,7,8], '.Array contains the right items';
is (5, 7, 8).Array.elems, 3, '.Array contains the right number of elements';
Expand Down

0 comments on commit 6a6cd4f

Please sign in to comment.