Skip to content

Commit

Permalink
niecza (auto)unfudge
Browse files Browse the repository at this point in the history
  • Loading branch information
coke committed Jan 3, 2012
1 parent 527ff7f commit 6c7def2
Show file tree
Hide file tree
Showing 20 changed files with 42 additions and 54 deletions.
2 changes: 1 addition & 1 deletion S02-literals/numeric.t
Expand Up @@ -50,7 +50,7 @@ is_approx 3.14159265358979323846264338327950288419716939937510e0,
}

# RT #70600
#?niecza skip 'exactly rounded Str->Num without FatRat'
#?niecza todo 'exactly rounded Str->Num without FatRat'
ok 0e999999999999999 == 0, '0e999999999999 equals zero';

done;
Expand Down
1 change: 0 additions & 1 deletion S02-literals/string-interpolation.t
Expand Up @@ -44,7 +44,6 @@ line 4
is $rt65538_in, $rt65538_out, 'interpolation does not trim newlines';
}

#?niecza skip 'System.InvalidCastException: Cannot cast from source type to destination type.'
{
is 'something'.new, '', '"string literal".new just creates an empty string';
is +''.new, 0, '... and that strinig works normally';
Expand Down
2 changes: 1 addition & 1 deletion S02-types/array_extending.t
Expand Up @@ -102,7 +102,7 @@ plan 21;
my $n = + @a.grep({ $_ eq 'b'});
is $n, 1, 'grep on extended array';
@a[1] = 'c'; # cmp doesn't handle Mu cmp Mu yet
#?niecza skip 'Use of uninitialized value in string context'
#?niecza todo 'Use of uninitialized value in string context'
is @a.min(), 'b', 'min on list with undefined el ignores it';
}

Expand Down
2 changes: 1 addition & 1 deletion S02-types/autovivification.t
Expand Up @@ -36,7 +36,7 @@ plan 10;
}

#?rakudo skip 'prefix:<\\>'
#?niecza skip 'disagree; captures should be context neutral'
#?niecza todo 'disagree; captures should be context neutral'
{
my %a;
my $b = \%a<b><c>;
Expand Down
2 changes: 1 addition & 1 deletion S02-types/bool.t
Expand Up @@ -86,7 +86,7 @@ is(--$bool, Bool::False, 'Decrement of Bool::False produces Bool::False');
is Bool::False.key, 'False', 'Bool::False.key works (is "False")';
}

#?niecza skip ".pick"
#?niecza skip 'rolling Bool generates Any, not True/False'
{
my $x = Bool.pick;
ok ($x === True || $x === False), 'Bool.pick return True or False';
Expand Down
2 changes: 1 addition & 1 deletion S02-types/catch_type_cast_mismatch.t
Expand Up @@ -15,7 +15,7 @@ plan 10;
my $ref = { val => 42 };
isa_ok($ref, Hash);
#?rakudo todo "die or fail?"
#?niecza skip "questionable test"
#?niecza todo "questionable test"
dies_ok { $ref[0] }, 'Hash !~~ Positional';

{
Expand Down
1 change: 0 additions & 1 deletion S02-types/num.t
Expand Up @@ -156,7 +156,6 @@ isa_ok(1 / 1, Rat);
}

#L<S02/The C<Num> and C<Rat> Types/may be bound to an arbitrary>
#?niecza skip 'System.FormatException: Unknown char: d'
{
my $a = "0d0101";
isa_ok(+$a, Int);
Expand Down
2 changes: 1 addition & 1 deletion S03-junctions/misc.t
Expand Up @@ -410,7 +410,7 @@ ok Mu & Mu ~~ Mu, 'Mu & Mu ~~ Mu works';
}

# stringy tests
#?niecza skip '#82'
#?niecza todo '#82'
{
my class Foo {
multi method gist(Foo:D:) { "gisted"; }
Expand Down
3 changes: 2 additions & 1 deletion S03-operators/binding-arrays.t
Expand Up @@ -27,7 +27,6 @@ plan 47;
is $var, "f", "basic binding of an array element (3)";
}

#?niecza skip 'delete'
{
my @array = <a b c>;
my $var = "d";
Expand All @@ -40,11 +39,13 @@ plan 47;
# $var unchanged, but assigning to $var doesn't modify @array any
# longer; similarily, changing @array[1] doesn't modify $var now
#?rakudo 3 todo 'array binding, delete'
#?niecza todo 'array binding, delete'
is $var, "e", "binding of array elements works with .delete (2)";
is ~@array, "a c", "binding of array elements works with .delete (3)";

$var = "f";
@array[1] = "g";
#?niecza todo 'array binding, delete'
is $var, "f", "binding of array elements works with .delete (4)";
is @array[1], "g", "binding of array elements works with .delete (5)";
}
Expand Down
1 change: 0 additions & 1 deletion S03-operators/boolean-bitwise.t
Expand Up @@ -68,7 +68,6 @@ plan 43;
ok( ?(True ?^False == True), '?^ works with Bools');
ok( ?(True ?^True == False), '?^ works with Bools');

#?niecza skip 'System.FormatException: Invalid format'
ok( ?('' ?^'' == False), '?^ works');
ok( ?(Any ?^ 1 == True), '?^ works');
ok( ?(-1 ?^ Any == True), '?^ works');
Expand Down
2 changes: 1 addition & 1 deletion S03-operators/cmp.t
Expand Up @@ -36,7 +36,6 @@ plan 18;
}

# cmp on Pair
#?niecza skip 'Cannot use value like Pair as a number'
{
is (:a<5> cmp :a<5>), 0, "cmp on Pair (1)";
is (:a<5> cmp :b<5>), -1, "cmp on Pair (2)";
Expand All @@ -45,6 +44,7 @@ plan 18;
is (:a<5> cmp :a<6>), -1, "cmp on Pair (5)";

my $cmp5 = { :$^q cmp :q<5> };
#?niecza todo 'cmp on Pair from local variable'
is $cmp5(5), 0, "cmp on Pair from local variable"
}

Expand Down
1 change: 0 additions & 1 deletion S03-operators/precedence.t
Expand Up @@ -150,7 +150,6 @@ is(((not 1,42)[1]), 42, "not is tighter than comma");
is(@d, [1 .. 4], "to complicate things further, it dwims");
}

#?niecza skip 'Bogus term'
{
my @b;
@b = ((1, 3) Z (2, 4));
Expand Down
1 change: 0 additions & 1 deletion S03-sequence/basic.t
Expand Up @@ -155,7 +155,6 @@ is eval((1 ... 5).perl).join(','), '1,2,3,4,5',
'eval($sequence.perl) reproduces result list';

# RT 98790
#?niecza skip "Internal error in exception dispatch: Catching frame has no caller?iter_flatten"
is ~((1 ... *) Z~ ('a' ... 'z')).[^5], "1a 2b 3c 4d 5e", "Zipping two sequence in parallel";

{
Expand Down
47 changes: 28 additions & 19 deletions S04-phasers/descending-order.t
@@ -1,56 +1,65 @@
use v6;

# Test the running order of phasers
# These blocks appear in descending order
# Test the running order of BEGIN/CHECK/INIT/END
# These blocks appear in ascending order
# [TODO] add tests for ENTER/LEAVE/KEEP/UNDO/PRE/POST/etc

use Test;

plan 7;
plan 8;

# L<S04/Phasers/END "at run time" ALAP>

my $var;
my ($var_at_enter, $var_at_init, $var_at_check, $var_at_begin);
my ($var_at_begin, $var_at_check, $var_at_init, $var_at_start, $var_at_enter);
my $eof_var;

$var = 13;

my $hist;

END {
# tests for END blocks:
is $var, 13, '$var gets initialized at END time';
is $eof_var, 29, '$eof_var gets assigned at END time';
# XXX check if BEGIN blocks do have to remember side effects
BEGIN {
$hist ~= 'begin ';
$var_at_begin = $var;
}

ENTER {
$hist ~= 'enter ';
$var_at_enter = $var;
CHECK {
$hist ~= 'check ';
$var_at_check = $var;
}

INIT {
$hist ~= 'init ';
$var_at_init = $var;
}

CHECK {
$hist ~= 'check ';
$var_at_check = $var;
ENTER {
$hist ~= 'enter ';
$var_at_enter = $var;
}

BEGIN {
$hist ~= 'begin ';
$var_at_begin = $var;
START {
$hist ~= 'start ';
$var_at_start = $var + 1;
}

#?niecza todo 'niecza has "enter", also'
is $hist, 'begin check init ', 'BEGIN {} runs only once';
END {
# tests for END blocks:
is $var, 13, '$var gets initialized at END time';
is $eof_var, 29, '$eof_var gets assigned at END time';
}

todo('niecza has "enter", also'); is $hist, 'begin check init start ', 'BEGIN {} runs only once';
nok $var_at_begin.defined, 'BEGIN {...} ran at compile time';
nok $var_at_check.defined, 'CHECK {...} ran at compile time';
nok $var_at_init.defined, 'INIT {...} ran at runtime, but ASAP';
nok $var_at_enter.defined, 'ENTER {...} at runtime, but before the mainline body';
is $var_at_start, 14, 'START {...} at runtime, just in time';

$eof_var = 29;

# vim: ft=perl6

say "# FUDGED!";

2 changes: 0 additions & 2 deletions S05-capture/subrule.t
Expand Up @@ -77,9 +77,7 @@ is(~$/<caprep>[0], "abcabcabcabc", 'Caprep abc one captured');

# RT #96424
{
#?niecza skip 'Unable to resolve method digit in class Cursor'
ok '0' ~~ /<alpha>|<digit>/, 'regex matches';
#?niecza todo
is $<alpha>.Str, '', 'Can call methods on captures from unsuccessful matches';
}

Expand Down
11 changes: 0 additions & 11 deletions S05-mass/stdrules.t
Expand Up @@ -55,7 +55,6 @@ ok("\x07A" ~~ m/<+alpha>/, q{Match unanchored alpha as charset});

# space

#?niecza skip 'Unable to resolve method space in class Cursor'
{
ok("\x[9]" ~~ m/^<.space>$/, q{Match space as subrule});
ok(!( "\x[9]" ~~ m/^<!space>.$/ ), q{Don't match negated space as subrule} );
Expand All @@ -76,7 +75,6 @@ ok("\x07A" ~~ m/<+alpha>/, q{Match unanchored alpha as charset});

# digit

#?niecza skip 'Unable to resolve method digit in class Cursor'
{
ok("0" ~~ m/^<.digit>$/, q{Match digit as subrule});
ok(!( "0" ~~ m/^<!digit>.$/ ), q{Don't match negated digit as subrule} );
Expand All @@ -97,7 +95,6 @@ ok("\x07A" ~~ m/<+alpha>/, q{Match unanchored alpha as charset});

# alnum

#?niecza skip 'Unable to resolve method alnum in class Cursor'
{
ok("n" ~~ m/^<.alnum>$/, q{Match alnum as subrule});
ok(!( "n" ~~ m/^<!alnum>.$/ ), q{Don't match negated alnum as subrule} );
Expand Down Expand Up @@ -132,7 +129,6 @@ ok("\x07A" ~~ m/<+alpha>/, q{Match unanchored alpha as charset});
# ok("+" ~~ m/<+ascii>/, q{Match unanchored ascii as charset});

# blank
#?niecza skip 'Unable to resolve method blank in class Cursor'
{
ok("\x[9]" ~~ m/^<.blank>$/, q{Match blank as subrule});
ok(!( "\x[9]" ~~ m/^<!blank>.$/ ), q{Don't match negated blank as subrule} );
Expand All @@ -153,7 +149,6 @@ ok("\x07A" ~~ m/<+alpha>/, q{Match unanchored alpha as charset});

# cntrl

#?niecza skip 'Unable to resolve method cntrl in class Cursor'
{
ok("\x[7F]" ~~ m/^<.cntrl>$/, q{Match cntrl as subrule});
ok(!( "\x[7F]" ~~ m/^<!cntrl>.$/ ), q{Don't match negated cntrl as subrule} );
Expand All @@ -174,7 +169,6 @@ ok("\x07A" ~~ m/<+alpha>/, q{Match unanchored alpha as charset});

# graph

#?niecza skip 'Unable to resolve method cntrl in class Cursor'
#?rakudo skip '<.graph>'
{
ok("V" ~~ m/^<.graph>$/, q{Match graph as subrule});
Expand All @@ -196,7 +190,6 @@ ok("\x07A" ~~ m/<+alpha>/, q{Match unanchored alpha as charset});

# lower

#?niecza skip 'Unable to resolve method lower in class Cursor'
{
ok("a" ~~ m/^<.lower>$/, q{Match lower as subrule});
ok(!( "a" ~~ m/^<!lower>.$/ ), q{Don't match negated lower as subrule} );
Expand All @@ -217,7 +210,6 @@ ok("\x07A" ~~ m/<+alpha>/, q{Match unanchored alpha as charset});

# print

#?niecza skip 'Unable to resolve method lower in class Cursor'
#?rakudo skip '<.print>'
{
ok("M" ~~ m/^<.print>$/, q{Match print as subrule});
Expand All @@ -239,7 +231,6 @@ ok("\x07A" ~~ m/<+alpha>/, q{Match unanchored alpha as charset});

# punct

#?niecza skip 'Unable to resolve method punct in class Cursor'
{
ok("[" ~~ m/^<.punct>$/, q{Match punct as subrule});
ok(!( "[" ~~ m/^<!punct>.$/ ), q{Don't match negated punct as subrule} );
Expand All @@ -260,7 +251,6 @@ ok("\x07A" ~~ m/<+alpha>/, q{Match unanchored alpha as charset});

# upper

#?niecza skip 'Unable to resolve method upper in class Cursor'
{
ok("A" ~~ m/^<.upper>$/, q{Match upper as subrule});
ok(!( "A" ~~ m/^<!upper>.$/ ), q{Don't match negated upper as subrule} );
Expand Down Expand Up @@ -300,7 +290,6 @@ ok("\x07A" ~~ m/<+alpha>/, q{Match unanchored alpha as charset});

# xdigit

#?niecza skip 'Unable to resolve method xdigit in class Cursor'
{
ok("0" ~~ m/^<.xdigit>$/, q{Match xdigit as subrule});
ok(!( "0" ~~ m/^<!xdigit>.$/ ), q{Don't match negated xdigit as subrule} );
Expand Down
1 change: 0 additions & 1 deletion S06-advanced/caller.t
Expand Up @@ -20,7 +20,6 @@ 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 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
10 changes: 5 additions & 5 deletions S06-signature/caller-param.t
Expand Up @@ -9,20 +9,20 @@ sub callerunderscore ($foo = $CALLER::_) {
is(callerunderscore("foo"), "-foo-", 'CALLER:: string arg');
is(callerunderscore(1), "-1-", 'CALLER:: number arg');
$_ = "foo";
#?niecza skip 'System.Exception: Improper null return from sub default for $foo = $CALLER::_ in MAIN callerunderscore'
#?niecza todo 'System.Exception: Improper null return from sub default for $foo = $CALLER::_ in MAIN callerunderscore'
is(callerunderscore(), "-foo-", 'CALLER:: $_ set once');
$_ = "bar";
#?niecza skip 'System.Exception: Improper null return from sub default for $foo = $CALLER::_ in MAIN callerunderscore'
#?niecza todo 'System.Exception: Improper null return from sub default for $foo = $CALLER::_ in MAIN callerunderscore'
is(callerunderscore(), "-bar-", 'CALLER:: $_ set twice');
for ("quux") {
#?niecza skip 'System.Exception: Improper null return from sub default for $foo = $CALLER::_ in MAIN callerunderscore'
#?niecza todo 'System.Exception: Improper null return from sub default for $foo = $CALLER::_ in MAIN callerunderscore'
is(callerunderscore(), '-quux-', 'CALLER:: $_ set by for');
}
given 'hirgel' {
#?niecza skip 'System.Exception: Improper null return from sub default for $foo = $CALLER::_ in MAIN callerunderscore'
#?niecza todo 'System.Exception: Improper null return from sub default for $foo = $CALLER::_ in MAIN callerunderscore'
is callerunderscore, '-hirgel-', '$CALLER::_ set by given';
}
#?niecza skip 'System.Exception: Improper null return from sub default for $foo = $CALLER::_ in MAIN callerunderscore'
#?niecza todo 'System.Exception: Improper null return from sub default for $foo = $CALLER::_ in MAIN callerunderscore'
is(callerunderscore(), '-bar-', 'CALLER:: $_ reset after for');


Expand Down
2 changes: 0 additions & 2 deletions S32-hash/pairs.t
Expand Up @@ -16,7 +16,6 @@ Basic C<pairs> tests, see S32::Containers.
my %hash = (a => 1, b => 2, c => 3);
my @pairs;
ok((@pairs = %hash.pairs), "pairs on hashes");
#?niecza skip 'Cannot use value like Pair as a number'
ok((@pairs = @pairs.sort), 'Can sort list of pairs');
is +@pairs, 3, "pairs on hashes returned the correct number of elems";
if +@pairs != 3 {
Expand Down Expand Up @@ -46,7 +45,6 @@ Basic C<pairs> tests, see S32::Containers.
}

# This next group added by Darren Duncan following discovery while debugging ext/Locale-KeyedText:
#?niecza skip 'Cannot use value like Pair as a number'
{
my $hash_of_2_pairs = {'a'=>'b','c'=>'d'};
my $hash_of_1_pair = {'a'=>'b'};
Expand Down
1 change: 0 additions & 1 deletion S32-num/power.t
Expand Up @@ -60,7 +60,6 @@ is_approx((-3i) ** 3, 27i, "-3i ** 3 = 27i");
is_approx (-1) ** -i, 23.1406926327793, "(-1) ** -i is approx 23.1406926327793";

#?DOES 4
#?niecza skip 'roots'
{
for (8i).roots(4) -> $z {
is_approx($z ** 4, 8i, "quartic root of 8i ** 4 = 8i");
Expand Down

0 comments on commit 6c7def2

Please sign in to comment.