Browse files

pugs fudges

  • Loading branch information...
1 parent 1bf4f1d commit b6ba504573109d3c969dc6e7f0de12ac60f95a34 @coke coke committed Feb 26, 2012
View
3 S04-statements/while.t
@@ -48,6 +48,7 @@ plan 9;
#?mildew skip 1
# L<S04/The C<for> statement/It is also possible to write>
# while ... -> $x {...}
+#?pugs skip 'Cannot bind to non-existing variable: "$x"'
{
my @array = 1..5;
my $str = "";
@@ -58,6 +59,7 @@ plan 9;
}
#?mildew skip 1
+#?pugs skip "Cannot 'pop' scalar"
{
my @array = 0..5;
my $str = "";
@@ -69,6 +71,7 @@ plan 9;
#?mildew skip 1
# L<S04/Statement parsing/keywords require whitespace>
+#?pugs todo
{
eval_dies_ok('my $i = 1; while($i < 5) { $i++; }',
'keyword needs at least one whitespace after it');
View
8 S05-modifier/perl5_0.t
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 17;
+plan 24;
# Really really really minimal s:P5//// and m:P5 tests. Please add more!!
@@ -40,11 +40,11 @@ my $bad = "1 ";
$bad ~~ s:Perl5:g/\s*//;
is($bad, "1", 'Zero width replace works with :g');
+#?pugs skip 'temp'
{
my $r;
temp $_ = 'heaao';
s:Perl5 /aa/ll/ && ($r = $_);
- #?pugs todo 'bug'
is $r, 'hello', 's/// in boolean context properly defaults to $_';
}
@@ -57,8 +57,11 @@ is($vals, 2, 'returned two values in the match');
# return all the strings we matched
my @vals = "hello world" ~~ m:P5:g/(\w+)/;
+#?pugs todo
is(+@vals, 2, 'returned two values in the match');
+#?pugs todo
is(@vals[0], 'hello', 'returned correct first value in the match');
+#?pugs todo
is(@vals[1], 'world', 'returned correct second value in the match');
@@ -79,6 +82,7 @@ so it looks like a pugs-pcre interface bug.
{
"a" ~~ m:Perl5/a|(b)/;
+ #?pugs todo
nok($0.defined, 'An unmatched capture should be undefined.');
my $str = "http://foo.bar/";
ok(($str ~~ m:Perl5 {http{0,1}}));
View
16 S05-modifier/perl5_6.t
@@ -11,13 +11,12 @@ unless "a" ~~ rx:P5/a/ {
exit;
}
-force_todo(15..18); # PCRE hard parsefails
-
my $b = 'x';
my $backspace = "\b";
my $bang = '!';
is(("a\nb\nc\n" ~~ rx:P5/((?m)^b)/ && $0), "b", 're_tests 763/1 (959)');
+#?pugs 2 skip 'reference to non-existent subpattern'
ok((not ("a" ~~ rx:P5/(?(1)a|b)/)), 're_tests 764 (960)');
is(("a" ~~ rx:P5/(?(1)b|a)/ && $/), "a", 're_tests 766/0 (962)');
ok((not ("a" ~~ rx:P5/(x)?(?(1)a|b)/)), 're_tests 768 (964)');
@@ -31,14 +30,11 @@ ok((not ("(blah" ~~ rx:P5/^(\()?blah(?(1)(\)))$/)), 're_tests 782 (978)');
is(("(blah)" ~~ rx:P5/^(\(+)?blah(?(1)(\)))$/ && $1), ")", 're_tests 784/2 (980)');
ok((not ("blah)" ~~ rx:P5/^(\(+)?blah(?(1)(\)))$/)), 're_tests 786 (982)');
ok((not ("(blah" ~~ rx:P5/^(\(+)?blah(?(1)(\)))$/)), 're_tests 788 (984)');
-flunk("PCRE hard parsefail");
-#ok((not ("a" ~~ rx:P5/(?(?{0})a|b)/)), 're_tests 790 (986)');
-flunk("PCRE hard parsefail");
-#is(("a" ~~ rx:P5/(?(?{0})b|a)/ && $/), "a", 're_tests 791/0 (987)');
-flunk("PCRE hard parsefail");
-#ok((not ("a" ~~ rx:P5/(?(?{1})b|a)/)), 're_tests 792 (988)');
-flunk("PCRE hard parsefail");
-#is(("a" ~~ rx:P5/(?(?{1})a|b)/ && $/), "a", 're_tests 793/0 (989)');
+#?pugs 4 skip 'assertion expected after (?(")'
+ok((not ("a" ~~ rx:P5/(?(?{0})a|b)/)), 're_tests 790 (986)');
+is(("a" ~~ rx:P5/(?(?{0})b|a)/ && $/), "a", 're_tests 791/0 (987)');
+ok((not ("a" ~~ rx:P5/(?(?{1})b|a)/)), 're_tests 792 (988)');
+is(("a" ~~ rx:P5/(?(?{1})a|b)/ && $/), "a", 're_tests 793/0 (989)');
ok((not ("a" ~~ rx:P5/(?(?!a)a|b)/)), 're_tests 794 (990)');
is(("a" ~~ rx:P5/(?(?!a)b|a)/ && $/), "a", 're_tests 795/0 (991)');
ok((not ("a" ~~ rx:P5/(?(?=a)b|a)/)), 're_tests 796 (992)');
View
2 S06-macros/returning-string.t
@@ -11,8 +11,10 @@ plan 8;
macro dollar_foo { $was_in_macro = 1; '$COMPILING::foo' }
is $was_in_macro, 1, "string returning macro was called at compile time";
my $foo = 42;
+ #?pugs todo
is dollar_foo, $foo, "simple string returning macro (1)";
dollar_foo() = 23;
+ #?pugs todo
is $foo, 23, "simple string returning macro (2)";
}
View
2 S14-roles/stubs.t
@@ -7,6 +7,7 @@ role WithStub { method a() { ... } };
role ProvidesStub1 { method a() { 1 } };
role ProvidesStub2 { method a() { 2 } };
+#?pugs todo
dies_ok { eval 'class A does WithStub { }' },
'need to implement stubbed methods at role-into-class composition time';
lives_ok { eval 'role B does WithStub { }' },
@@ -15,6 +16,7 @@ lives_ok { eval 'class C does WithStub { method a() { 3 } }' },
'directly implementing the stubbed method is fine';
lives_ok { eval 'class D does WithStub does ProvidesStub1 { }' },
'composing the stubbed method is fine';
+#?pugs todo
dies_ok { eval 'class E does WithStub does ProvidesStub1 does ProvidesStub2 { }' },
'composing stub and 2 implementations dies again';
lives_ok { eval 'class F does WithStub does ProvidesStub1 does ProvidesStub2 {
View
4 S32-container/roundrobin.t
@@ -32,10 +32,10 @@ ok(roundrobin({'a'=>1,'b'=>2,'c'=>3}) eqv ('a'=>1,'b'=>2,'c'=>3),
ok(roundrobin((); 1; 2..4; [5..7]; {'a'=>1,'b'=>2})
eqv (1, 2, 5, 'a'=>1, 3, 6, 'b'=>2, 4, 7), 'basic roundrobin');
-#?pugs todo 'feature'
+#?pugs skip 'Named argument found where no matched parameter expected'
ok(roundrobin(:shortest, 1; 1..2; 1..3) eqv (1), 'roundrobin :shortest');
-#?pugs todo 'these tests depend on lazy roundrobin'
+#?pugs todo
flunk('roundrobin :finite');
=begin lazy_roundrobin
View
4 S32-container/zip.t
@@ -74,16 +74,18 @@ plan 12;
is(@b, [2, 4], "second half of the lvalue zip");
}
+#?pugs todo
{
my @a = (1..3, 5) Z (6..8, 10);
is @a.join(', '), "1, 6, 2, 7, 3, 8, 5, 10", 'infix:<Z> imposes list context';
}
# mix arrays and ranges
-
+#?pugs todo
is ('a'..'c' Z 1, 2, 3).join(','), 'a,1,b,2,c,3',
'can mix arrays and ranges for infix:<Z>';
+#?pugs todo
is ("a".."c" Z "?", "a".."b").join('|'), 'a|?|b|a|c|b',
'can mix arrays and ranges for infix:<Z>';
View
1 S32-list/create.t
@@ -17,6 +17,7 @@ is($list_sub, (1, 2, 3), 'The &list() function created a list.');
is(+$list_sub, 3, 'Finding the length of the list works as expected.');
#?niecza skip 'Excess arguments to List.new, used 1 of 4 positionals'
+#?pugs skip 'Must only use named arguments to new() constructor'
{
my $list_obj = List.new(4, 5, 6);
isa_ok($list_obj, List, 'Creating a new list object with new works.');
View
5 S32-list/reverse.t
@@ -22,6 +22,7 @@ is(@a, @e, "list was reversed");
{
my $a = reverse("foo");
+ #?pugs todo
is($a, "foo", "string was not reversed; that's what flip() is for");
@a = reverse "foo", "bar";
@@ -65,9 +66,11 @@ is(@a, @e, "list was reversed");
my @a = "foo";
my @b = @a.reverse;
#?niecza skip "Iterable NYI"
+ #?pugs skip "Iterable NYI"
isa_ok(@b, Iterable);
my $b = @a.reverse;
#?niecza skip "Iterable NYI"
+ #?pugs skip "Iterable NYI"
isa_ok($b, Iterable);
is(@b[0], "foo", 'our list is reversed properly');
is($b, "foo", 'in scalar context it is still a list');
@@ -80,9 +83,11 @@ is(@a, @e, "list was reversed");
my @a = ("foo", "bar");
my @b = @a.reverse;
#?niecza skip "Iterable NYI"
+ #?pugs skip "Iterable NYI"
isa_ok(@b, Iterable);
my $b = @a.reverse;
#?niecza skip "Iterable NYI"
+ #?pugs skip "Iterable NYI"
isa_ok($b, Iterable);
is(@b[0], "bar", 'our array is reversed');
is(@b[1], "foo", 'our array is reversed');
View
3 S32-num/abs.t
@@ -14,6 +14,7 @@ for 0, 0 / 1, 0.0e0, 1, 50, 60.0e0, 99.99 -> $x {
is(abs($x), $x, "got the right absolute value for $x");
is($x.abs, $x, 'got the right absolute value for $x='~$x);
+ #?pugs 2 skip '.gist'
is (abs($x)).WHAT.gist, $x.WHAT.gist, 'type of abs($x) agrees with type of $x';
is $x.abs.WHAT.gist, $x.WHAT.gist, 'type of $x.abs agrees with type of $x';
}
@@ -22,6 +23,7 @@ for -1, -50, -60.0e0, -9999 / 100 {
is(abs($_), -$_, "got the right absolute value for $_");
is(.abs, -$_, 'got the right absolute value for $_='~$_);
+ #?pugs 2 skip '.gist'
is (abs($_)).WHAT.gist, $_.WHAT.gist, 'type of abs($_) agrees with type of $_';
is $_.abs.WHAT.gist, $_.WHAT.gist, 'type of $_.abs agrees with type of $_';
}
@@ -33,6 +35,7 @@ is( abs(-Inf), Inf, 'absolute value of -Inf is Inf');
is( abs("-10"), 10, 'absolute value of "-10" is 10');
#?rakudo todo "abs(70596).WHAT parsing as abs(70596.WHAT)"
+#?pugs skip '.gist'
is( abs(70596).WHAT.gist, 70596.abs.WHAT.gist, 'abs(x).WHAT parses as x.abs.WHAT' );
done;
View
5 S32-num/log.t
@@ -20,6 +20,7 @@ is_approx(log(5), $log_5, 'got the log of 5');
is_approx(log(0.1), $log_one_tenth, 'got the log of 0.1');
# with given base:
+#?pugs 3 skip 'No compatible multi variant found: "&log"'
is_approx(log(8, 2), 3, 'log(8, 2) is 3');
is_approx(log(42, 23), 1.192051192, 'log(42, 23)');
@@ -49,24 +50,20 @@ is( log10(NaN), NaN, 'log10(NaN) = NaN');
# I use 1i instead of i since I don't know if a bare i will be supported
# log(exp(i pi)) = i pi log(exp(1)) = i pi
-#?pugs 2 todo 'feature'
is_approx(log(-1 + 0i,), 0 + 1i * $pi, "got the log of -1");
is_approx(log10(-1 + 0i), 0 + 1i * $pi / log(10), "got the log10 of -1");
# log(exp(1+i pi)) = 1 + i pi
-#?pugs 2 todo 'feature'
is_approx(log(-exp(1) + 0i), 1 + 1i * $pi, "got the log of -e");
is_approx(log10(-10 + 0i), 1 + 1i * $pi / log(10), "got the log10 of -10");
is_approx(log10(10), 1.0, 'log10(10)=1');
-#?pugs todo 'feature'
is_approx(log((1+1i) / sqrt(2)), 0 + 1i * $pi / 4, "got log of exp(i pi/4)");
is_approx(log(1i), 1i * $pi / 2, "got the log of i (complex unit)");
is_approx(log10(1i), 1i * $pi / (2*log(10)), 'got the log10 of i');
is_approx(log10((1+1i) / sqrt(2)), 0 + 1i * $pi / (4*log(10)), "got log10 of exp(i pi/4)");
-#?pugs todo 'feature'
is_approx(log(-1i), -0.5i * $pi , "got the log of -i (complex unit)");
is_approx(log10(-1i), -0.5i * $pi / log(10), "got the log10 of -i (complex unit)");

0 comments on commit b6ba504

Please sign in to comment.