Skip to content

Commit

Permalink
niecza unfudge
Browse files Browse the repository at this point in the history
moritz++ # many of these from autounfudge
  • Loading branch information
coke committed Dec 22, 2011
1 parent 4401e31 commit 5f0bdab
Show file tree
Hide file tree
Showing 47 changed files with 43 additions and 96 deletions.
2 changes: 1 addition & 1 deletion S02-lexical-conventions/unicode.t
Expand Up @@ -110,7 +110,7 @@ is((do { my $दूसरा = 2; sub टोटल ($x) { $x + 2 }; टोटल
# L<S02/Unicode Semantics/Perl can count Unicode line and paragraph separators>
#?rakudo: todo 'PS does not work to separate lines'
#?niecza skip 'PS does not work to separate lines'
#?niecza todo 'PS does not work to separate lines'
eval_lives_ok "\{ 1 \} \x2029 \{ 1 \}", "Unicode 2029 can terminate lines";
# L<S02/Bracketing Characters/If a character is already used>
Expand Down
2 changes: 1 addition & 1 deletion S02-names/caller.t
Expand Up @@ -84,7 +84,7 @@ plan 18;
}

my $abs = 23;
#?niecza skip 'strictness'
#?niecza todo 'strictness'
dies_ok { bar() },
'vars not declared "is dynamic" are not accessible via $CALLER::';
}
Expand Down
4 changes: 2 additions & 2 deletions S02-types/array.t
Expand Up @@ -158,11 +158,11 @@ my @array2 = ("test", 1, Mu);
ok(eval('@array11[2,0] = 12'), "push the value to a multidimension array");
}

#?niecza skip "type constraints"
{
# declare the array with data type
my Int @array;
lives_ok { @array[0] = 23 }, "stuffing Ints in an Int array works";
#?niecza todo "type constraints"
dies_ok { @array[1] = $*ERR }, "stuffing IO in an Int array does not work";
}

Expand Down Expand Up @@ -243,7 +243,7 @@ my @array2 = ("test", 1, Mu);

eval_dies_ok '@arr[-1]', "readonly accessing [-1] of normal array is compile-time error";
#?rakudo todo '@arr[-1] returns failure, not dies'
#?niecza skip '@arr[-1] returns undef'
#?niecza todo '@arr[-1] returns undef'
dies_ok { @arr[ $minus_one ] }, "indirectly accessing [-1] " ~
"through a variable is run-time error";
dies_ok { @arr[$minus_one] = 42 }, "assigning to [-1] of a normal array is fatal";
Expand Down
2 changes: 1 addition & 1 deletion S02-types/hash.t
Expand Up @@ -247,7 +247,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'
#?niecza todo '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
2 changes: 1 addition & 1 deletion S02-types/mixed_multi_dimensional.t
Expand Up @@ -206,7 +206,7 @@ Some deeper tests were already added.
#?rakudo 2 todo 'unknown'
#?niecza todo
is(+@array[1]<two>[0], 2, "two keys at level 4");
#?niecza skip 'Use of uninitialized value in string context'
#?niecza todo 'Use of uninitialized value in string context'
is(@array[1]<two>[0]<f><other>, 5, "more keys at level 4");
}

Expand Down
6 changes: 0 additions & 6 deletions S02-types/num.t
Expand Up @@ -40,35 +40,30 @@ is_approx( eval((-1.1).perl), -1.1, 'eval -1.1.Num.perl is -1.1' );
{
my $a = 1 / 1;
isa_ok($a, Rat);
#?niecza todo
is(~$a, "1", '1/1 stringification works');
}

{
my $a = -1.0;
isa_ok($a, Rat);
#?niecza todo
is($a, "-1", '-1 stringification works');
}

{
my $a = 0.1;
isa_ok($a, Rat);
#?niecza todo
is($a, "0.1", '0.1 stringification works');
}

{
my $a = -0.1; "$a";
isa_ok($a, Rat);
#?niecza todo
is($a, "-0.1", '-0.1 stringification works');
}

{
my $a = 10.01; "$a";
isa_ok($a, Rat);
#?niecza todo
is($a, "10.01", '10.01 stringification works');
}

Expand Down Expand Up @@ -154,7 +149,6 @@ isa_ok(1 / 1, Rat);
}

#L<S02/The C<Num> and C<Rat> Types/Perl 6 intrinsically supports big integers>
#?niecza skip 'System.FormatException: Unknown char: d'
{
my $a = "1.01";
isa_ok($a.Int, Int);
Expand Down
8 changes: 4 additions & 4 deletions S03-metaops/reduce.t
Expand Up @@ -88,7 +88,7 @@ L<"http://groups.google.de/group/perl.perl6.language/msg/bd9eb275d5da2eda">
is ~ ([\>] 4, 2, 3, 1).map({+$_}), "1 1 0 0", "[\\>] works (2)";
is ~ ([\==] 4, 4, 4).map({+$_}), "1 1 1", "[\\==] works (1)";
is ~ ([\==] 4, 5, 4).map({+$_}), "1 0 0", "[\\==] works (2)";
#?niecza 2 skip 'this is parsed as ![=], not good'
#?niecza 2 todo 'this is parsed as ![=], not good'
is ~ ([\!=] 4, 5, 6).map({+$_}), "1 1 1", "[\\!=] works (1)";
is ~ ([\!=] 4, 5, 5).map({+$_}), "1 1 0", "[\\!=] works (2)";
is (~ [\**] 1, 2, 3), "3 8 1", "[\\**] (right assoc) works (1)";
Expand All @@ -98,7 +98,7 @@ L<"http://groups.google.de/group/perl.perl6.language/msg/bd9eb275d5da2eda">
# RT #76110
{
is ~([\+] [\+] 1 xx 5), '1 3 6 10 15', 'two nested [\+]';
#?niecza skip 'unary [] does not context yet'
#?niecza todo 'unary [] does not context yet'
is ([+] [1, 2, 3, 4]), 4, '[+] does not flatten []-arrays';
}

Expand Down Expand Up @@ -168,9 +168,9 @@ L<"http://groups.google.de/group/perl.perl6.language/msg/bd9eb275d5da2eda">
}

# Following two tests taken verbatim from former t/operators/reduce.t
#?niecza 2 skip 'These are hyperop tests!'
lives_ok({my @foo = [1..3] >>+<< [1..3] >>+<< [1..3]},'Sanity Check');
#?rakudo todo 'reduced hyper op'
#?niecza todo 'These are hyperop tests!'
lives_ok({my @foo = [>>+<<] ([1..3],[1..3],[1..3])},'Parse [>>+<<]');

# Check that user defined infix ops work with [...], too.
Expand All @@ -196,7 +196,7 @@ lives_ok({my @foo = [>>+<<] ([1..3],[1..3],[1..3])},'Parse [>>+<<]');

# L<S03/"Reduction operators"/"Among the builtin operators, [+]() returns 0 and [*]() returns 1">

#?niecza skip '[*] identity'
#?niecza todo '[*] identity'
is( ([*]()), 1, "[*]() returns 1");
is( ([+]()), 0, "[+]() returns 0");

Expand Down
2 changes: 0 additions & 2 deletions S03-metaops/reverse.t
Expand Up @@ -53,9 +53,7 @@ is 4 Rcmp 5, 5 cmp 4, "4 Rcmp 5";
isa_ok 4 Rcmp 5, (5 cmp 4).WHAT, "4 Rcmp 5 is the same type as 5 cmp 4";

# precedence tests!
#?niecza todo
is 3 R/ 9 + 5, 8, 'R/ gets precedence of /';
#?niecza todo
is 4 R- 5 R/ 10, -2, "Rop gets the precedence of op";
is (9 R... 1, 3), (1, 3, 5, 7, 9), "Rop gets list_infix precedence correctly";

Expand Down
4 changes: 2 additions & 2 deletions S03-operators/binding-scalars.t
Expand Up @@ -96,13 +96,13 @@ plan 30;
$b($val);
is $a, 42, "bound readonly sub param was bound correctly (1)";
$val++;
#?niecza skip "difference of interpretation on ro binding"
#?niecza todo "difference of interpretation on ro binding"
#?rakudo todo 'nom regression'
is $a, 43, "bound readonly sub param was bound correctly (2)";

dies_ok { $a = 23 },
"bound readonly sub param remains readonly (1)";
#?niecza skip "difference of interpretation on ro binding"
#?niecza todo "difference of interpretation on ro binding"
#?rakudo todo 'nom regression'
is $a, 43,
"bound readonly sub param remains readonly (2)";
Expand Down
2 changes: 1 addition & 1 deletion S03-operators/range-basic.t
Expand Up @@ -191,9 +191,9 @@ nok 'a' ~~ 'b'..'g', "not 'a' ~~ 'b'..'g'";
nok 'h' ~~ 'b'..'g', "not 'h' ~~ 'b'..'g'";
nok 0 ~~ 'a'..'g', "not 0 ~~ 'a'..'g'";

#?niecza 4 skip 'alphabetic/* ranges'
ok 'd' ~~ 'c'..*, "'d' ~~ 'c'..*";
nok 'b' ~~ 'c'..*, "not 'b' ~~ 'c'..*";
#?niecza todo 'alphabetic/* ranges'
ok 'b' ~~ *..'c', "'b' ~~ *..'c'";
nok 'd' ~~ *..'c', "not 'd' ~~ *..'c'";

Expand Down
3 changes: 0 additions & 3 deletions S03-operators/range.t
Expand Up @@ -98,7 +98,6 @@ is (1..6 Z 'a' .. 'c').join, '1a2b3c', 'Ranges and infix:<Z>';
# 16:16 <TimToady> ~(1.9 ^..^ 4.9) should produce 2.9, 3.9
# 16:17 <pmichaud> and ~(1.9 ^..^ 4.5) would produce the same?
# 16:17 <TimToady> yes
#?niecza 4 todo
is ~(1.1 .. 4) , "1.1 2.1 3.1", "range with float .min";
is ~(1.9 .. 4) , "1.9 2.9 3.9", "range with float .min";
is ~(1.1 ^.. 4), "2.1 3.1" , "bottom exclusive range of float";
Expand All @@ -109,13 +108,11 @@ is (1..6 Z 'a' .. 'c').join, '1a2b3c', 'Ranges and infix:<Z>';
is ~(1 ..^ 4.1), "1 2 3 4", "top exclusive range of float";
is ~(1 ..^ 4.9), "1 2 3 4", "top exclusive range of float";

#?niecza 4 todo
is ~(1.1 .. 4.1), "1.1 2.1 3.1 4.1", "range with float .min/.max";
is ~(1.9 .. 4.1), "1.9 2.9 3.9" , "range with float .min/.max";
is ~(1.1 .. 4.9), "1.1 2.1 3.1 4.1", "range with float .min/.max";
is ~(1.9 .. 4.9), "1.9 2.9 3.9 4.9", "range with float .min/.max";

#?niecza 4 todo
is ~(1.1 ^..^ 4.1), "2.1 3.1" , "both exclusive float range";
is ~(1.9 ^..^ 4.1), "2.9 3.9" , "both exclusive float range";
is ~(1.1 ^..^ 4.9), "2.1 3.1 4.1", "both exclusive float range";
Expand Down
4 changes: 2 additions & 2 deletions S03-operators/subscript-adverbs.t
Expand Up @@ -25,7 +25,7 @@ plan 64;
is ~(@array[0,1]:p), "0\ta 1\tB",
":p on an array returned a two-elem array consisting of the correct pairs";

#?niecza skip 'Cannot use value like Pair as a number'
#?niecza todo 'Cannot use value like Pair as a number'
is +(@array[42,23]:p), 0, ":p on an array weeded out non-existing entries (1)";
#?niecza todo
is ~(@array[42,23]:p), "", ":p on an array weeded out non-existing entries (2)";
Expand Down Expand Up @@ -126,7 +126,7 @@ plan 64;
is ~(%hash<0 1>:p), "0\ta 1\tB",
":p on a hash returned a two-elem array consisting of the correct pairs";

#?niecza skip 'Cannot use value like Pair as a number'
#?niecza todo 'Cannot use value like Pair as a number'
is +(%hash<42 23>:p), 0, ":p on a hash weeded out non-existing entries (1)";
#?niecza todo
is ~(%hash<42 23>:p), "", ":p on a hash weeded out non-existing entries (2)";
Expand Down
4 changes: 0 additions & 4 deletions S03-sequence/basic.t
Expand Up @@ -18,7 +18,6 @@ is (1, 3 ... 9).join(', '), '1, 3, 5, 7, 9', 'simple additive sequence with two
is (1, 0 ... -3).join(', '), '1, 0, -1, -2, -3', 'simple decreasing additive sequence with two items on the LHS';
is (1, 3, 5 ... 9).join(', '), '1, 3, 5, 7, 9', 'simple additive sequence with three items on the LHS';
is (1, 3, 9 ... 81).join(', '), '1, 3, 9, 27, 81', 'simple multiplicative sequence with three items on the LHS';
#?niecza todo 'Int-valued Rats written as N/1'
is (81, 27, 9 ... 1).join(', '), '81, 27, 9, 3, 1', 'decreasing multiplicative sequence with three items on the LHS';
is (1, { $_ + 2 } ... 9).join(', '), '1, 3, 5, 7, 9', 'simple sequence with one item and block closure on the LHS';
is (1, *+2 ... 9).join(', '), '1, 3, 5, 7, 9', 'simple sequence with one item and * closure on the LHS';
Expand All @@ -43,7 +42,6 @@ is (1, 3 ... 10).[^6].join(', '), '1, 3, 5, 7, 9, 11', 'simple additive sequence
is (1, 0 ... -3.5).[^6].join(', '), '1, 0, -1, -2, -3, -4', 'simple decreasing additive sequence with two items on the LHS';
is (1, 3, 5 ... 10).[^6].join(', '), '1, 3, 5, 7, 9, 11', 'simple additive sequence with three items on the LHS';
is (1, 3, 9 ... 100).[^6].join(', '), '1, 3, 9, 27, 81, 243', 'simple multiplicative sequence with three items on the LHS';
#?niecza todo 'Int-valued Rats written as N/1'
is (81, 27, 9 ... 8/9).[^6], (81, 27, 9, 3, 1, 1/3), 'decreasing multiplicative sequence with three items on the LHS';
is (1, { $_ + 2 } ... 10).[^6].join(', '), '1, 3, 5, 7, 9, 11', 'simple sequence with one item and block closure on the LHS';
is (1, *+2 ... 10).[^6].join(', '), '1, 3, 5, 7, 9, 11', 'simple sequence with one item and * closure on the LHS';
Expand All @@ -65,7 +63,6 @@ is (1, 0 ... *).[^5].join(', '), '1, 0, -1, -2, -3', 'simple decreasing additive
is (1, 3, 5 ... *).[^5].join(', '), '1, 3, 5, 7, 9', 'simple additive sequence with three items on the LHS';
is (8, 7, 6 ... *).[^5].join(', '), '8, 7, 6, 5, 4', 'simple decreasing additive sequence with three items on the LHS';
is (1, 3, 9 ... *).[^5].join(', '), '1, 3, 9, 27, 81', 'simple multiplicative sequence with three items on the LHS';
#?niecza todo 'Int-valued Rats written as N/1'
is (81, 27, 9 ... *).[^5].join(', '), '81, 27, 9, 3, 1', 'decreasing multiplicative sequence with three items on the LHS';
is (1, { $_ + 2 } ... *).[^5].join(', '), '1, 3, 5, 7, 9', 'simple sequence with one item and block closure on the LHS';
is (1, *+2 ... *).[^5].join(', '), '1, 3, 5, 7, 9', 'simple sequence with one item and * closure on the LHS';
Expand Down Expand Up @@ -123,7 +120,6 @@ is (1, 2 ... 0).[^3], (1,2,3), 'No more: limit value is on the wrong side';
is (1 ...^ -3).join(', '), '1, 0, -1, -2', 'exclusive decreasing sequence';
is (1 ...^ 5.5).[^6].join(', '), '1, 2, 3, 4, 5, 6', "exclusive sequence that couldn't hit its limit anyway";
is (1, 3, 9 ...^ 81).join(', '), '1, 3, 9, 27', 'exclusive geometric sequence';
#?niecza todo 'Int-valued Rats written as N/1'
is (81, 27, 9 ...^ 2).[^5].join(', '), '81, 27, 9, 3, 1', "exclusive decreasing geometric sequence that couldn't hit its limit anyway";
is (2, -4, 8 ...^ 32).join(', '), '2, -4, 8, -16', 'exclusive alternating geometric sequence';
is (2, -4, 8 ...^ -32).[^6].join(', '), '2, -4, 8, -16, 32, -64', 'exclusive alternating geometric sequence (not an exact match)';
Expand Down
2 changes: 1 addition & 1 deletion S04-declarations/multiple.t
Expand Up @@ -28,7 +28,7 @@ eval_dies_ok 'sub foo {1; }; sub foo($x) {1; };',
eval_dies_ok 'only sub foo {1; }; sub foo($x) {1; };',
'multiple declarations need multi or proto';

#?niecza skip "MMD"
#?niecza todo "MMD"
#?rakudo todo 'nom regression'
eval_lives_ok 'proto foo {1; }; sub foo {1; }; sub foo($x) {1; };',
'multiple declarations need multi or proto';
Expand Down
4 changes: 2 additions & 2 deletions S04-declarations/my.t
Expand Up @@ -209,7 +209,7 @@ my $z = 42; #OK not used
{
my $a;
#?rakudo todo 'fails'
#?niecza 2 skip 'still fails?'
#?niecza 2 todo 'still fails?'
eval_lives_ok 'do { die "foo";my Int $x;CATCH { default { $a = ?($x ~~ Int) } } }';
#?rakudo todo 'previous test skipped'
ok $a, 'unreached declaration in effect at block start';
Expand Down Expand Up @@ -238,7 +238,7 @@ my $z = 42; #OK not used
my $a = 42;
our sub access_lexical_a() { $a }
}
#?niecza skip 'NYI'
#?niecza todo 'NYI'
is OUR::access_lexical_a(), 42,
'can call our-sub that accesses a lexical after the block was run';

Expand Down
2 changes: 1 addition & 1 deletion S04-phasers/enter-leave.t
Expand Up @@ -173,7 +173,7 @@ plan 19;
is $str, '1', 'die aborts ENTER queue';
}

#?niecza skip '@!'
#?niecza todo '@!'
{
my $str;
try {
Expand Down
4 changes: 2 additions & 2 deletions S04-phasers/pre-post.t
Expand Up @@ -86,7 +86,7 @@ my $foo = PRE_Child.new;

lives_ok { $foo.test(5) }, 'PRE in methods compiles and runs';
dies_ok { $foo.test(-42) }, 'PRE in child throws';
#?niecza skip 'PRE inheritance'
#?niecza todo 'PRE inheritance'
dies_ok { $foo.test(78) }, 'PRE in parent throws';


Expand Down Expand Up @@ -164,7 +164,7 @@ dies_ok { $pt.test(1) }, 'POST receives return value as $_ (failure)';
is $str, '(', 'failing PRE runs nothing else';
}

#?niecza skip 'I think POST runs LIFO by spec?'
#?niecza todo 'I think POST runs LIFO by spec?'
{
my $str;
try {
Expand Down
4 changes: 2 additions & 2 deletions S04-statement-modifiers/for.t
Expand Up @@ -59,14 +59,14 @@ use Test;
is $a, "<hello>", 'iterating one variable element works';
}

#?niecza skip "closure for"
#?niecza todo "closure for"
{
my $a = 0;
{ $a++ } for 1..3;
is $a, 3, 'the closure was called';
}

#?niecza skip "closure for"
#?niecza todo "closure for"
{
my $a = 0;
-> $i { $a += $i } for 1..3;
Expand Down
2 changes: 0 additions & 2 deletions S05-match/positions.t
Expand Up @@ -30,9 +30,7 @@ nok($/.from.defined, 'Match pos is undefined');
my regex Aa { A .* a }
#?rakudo 3 skip 'lexical lookup of <Aa>'
ok($str ~~ m/ .*? <Aa> /, 'Subrule match from 3');
#?niecza skip 'System.InvalidCastException: Cannot cast from source type to destination type.'
ok($/.from == 0, 'Full match pos is 0');
#?niecza skip 'Unable to resolve method from in class Any'
ok($/<Aa>.from == 3, 'Subrule match pos is 3');


Expand Down
4 changes: 2 additions & 2 deletions S06-advanced/caller.t
Expand Up @@ -10,7 +10,7 @@ use Test;
sub a_sub { b_sub() }
sub b_sub { try { caller.subname } }
#?pugs todo "feature"
#?niecza skip "try interferes with caller counting"
#?niecza todo "try interferes with caller counting"
is ~a_sub(), "a_sub", "caller.sub works";

# caller.file
Expand All @@ -20,7 +20,7 @@ ok index(~(try { caller.file }), "caller") >= 0, "caller.file works";
# caller.line (XXX: make sure to edit the expected line number!)
#?pugs 2 todo "feature"
sub call_line { caller.line };
#?niecza skip "fudge messes up the line numbers"
#?niecza todo "fudge messes up the line numbers"
is call_line(), 23, "caller.line works";

# pugs: caller exposes a bug in the MMD mechanism where directly using autogenerated
Expand Down
2 changes: 1 addition & 1 deletion S06-signature/errors.t
Expand Up @@ -25,12 +25,12 @@ eval_lives_ok 'sub quuuux ($!) { ... }', 'but $! is OK';
}

# RT #71478
#?niecza skip 'Excess arguments to MAIN_3 foo, used 1 of 2 positionals'
{
my $success = try { eval 'sub foo(%h) { %h }; foo(1, 2); 1' };
my $error = "$!";
nok $success,
"Passing two arguments to a function expecting one hash is an error";
#?niecza 3 todo 'error message content'
ok $error ~~ / '%h' /, '... error message mentions parameter';
ok $error ~~ /:i 'type' /, '... error message mentions "type"';
ok $error ~~ / Associative /, '... error message mentions "Associative"';
Expand Down
2 changes: 1 addition & 1 deletion S12-class/stubs.t
Expand Up @@ -12,7 +12,7 @@ eval_lives_ok q[ role StubB { ... }; role StubB { method foo { } }; ],
eval_lives_ok q[ module StubC { ... }; module StubC { sub foo { } }; ],
'Can stub a module, and later on declare it';

#?niecza skip 'broken in nom-derived stub model'
#?niecza todo 'broken in nom-derived stub model'
#?rakudo todo 'nom regression'
eval_lives_ok q[ package StubD { ... }; class StubD { method foo { } }; ],
'Can stub a package, and later on implement it as a method';
Expand Down
2 changes: 1 addition & 1 deletion S12-enums/basic.t
Expand Up @@ -88,13 +88,13 @@ dies_ok({ my Color $c3 = "for the fail" }, 'enum as a type enforces checks');
}

# L<S12/The C<.pick> Method/"define a .pick method">
#?niecza skip '.pick and .roll'
{
lives_ok { my Color $k = Color.pick }, 'Color.pick assigns to Color var';
isa_ok Color.pick, Color.pick.WHAT, 'Color.pick.isa';

ok ?(Color.pick == any(Color::white, Color::gray, Color::black)),
'.pick on enums';
#?niecza todo 'picking multiple elements from an enum'
ok Color.pick(2) == 2, '.pick(2) on enums';
}

Expand Down
2 changes: 1 addition & 1 deletion S13-type-casting/methods.t
Expand Up @@ -12,7 +12,7 @@ class CoercionTest {

my $o = CoercionTest.new();

#?niecza skip 'Stringy'
#?niecza todo 'Stringy'
is ~$o, 'foo', 'method Stringy takes care of correct stringification';
ok +$o == 1.2, 'method Numeric takes care of correct numification';

Expand Down

0 comments on commit 5f0bdab

Please sign in to comment.