Permalink
Browse files

niecza (auto)unfudge

  • Loading branch information...
1 parent 527ff7f commit 6c7def2ce3188dda7bbbe839506e84dbe428c76a @coke coke committed Jan 3, 2012
View
@@ -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;
@@ -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';
@@ -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';
}
@@ -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>;
View
@@ -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';
@@ -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';
{
View
@@ -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);
View
@@ -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"; }
@@ -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";
@@ -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)";
}
@@ -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');
View
@@ -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)";
@@ -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"
}
@@ -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));
View
@@ -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";
{
@@ -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!";
+
View
@@ -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';
}
View
@@ -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} );
@@ -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} );
@@ -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} );
@@ -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} );
@@ -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} );
@@ -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});
@@ -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} );
@@ -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});
@@ -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} );
@@ -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} );
@@ -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} );
View
@@ -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
@@ -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');
View
@@ -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 {
@@ -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'};
View
@@ -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");

0 comments on commit 6c7def2

Please sign in to comment.