Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

pugs fudges

  • Loading branch information...
commit 246ed8d50b15a3657f90cacd2cc0e7929d138031 1 parent 9a6c674
@coke coke authored
View
2  S02-literals/char-by-name.t
@@ -8,6 +8,7 @@ plan 10;
# L<S02/Unicode codepoints>
+#?pugs 4 todo
is "\c[LEFT CORNER BRACKET]", "", '\c[LEFT CORNER BRACKET]';
is "\c[RIGHT WHITE CORNER BRACKET]", "", '\c[RIGHT WHITE CORNER BRACKET]';
is "\c[FULLWIDTH RIGHT PARENTHESIS]", "", '\c[FULLWIDTH RIGHT PARENTHESIS]';
@@ -26,6 +27,7 @@ is("\c[LF]", "\c10", '\c[LF] works');
is "\c[LATIN CAPITAL LETTER A, LATIN CAPITAL LETTER B]", 'AB', 'two letters in \c[]';
is "\c[LATIN CAPITAL LETTER A, COMBINING GRAVE ACCENT]", "\x[0041,0300]", 'letter and combining char in \c[]';
+#?pugs todo
ok "\c[LATIN SMALL LETTER A WITH DIAERESIS,COMBINING CEDILLA]" ~~ /\w/,
'RT 64918 (some strings throw "Malformed UTF-8 string" errors';
View
4 S02-literals/char-by-number.t
@@ -13,6 +13,7 @@ is("\x[20]", ' ', '\x[20] normal space');
is("\x[a0]", chr(0xa0), '\x[a0] non-breaking space');
is("\x[263a]", '', '\x[263a] wide hex character (SMILEY)');
is("\x[6211]", '', '\x[597d] wide hex character (Chinese char)');
+#?pugs 2 todo
eval_dies_ok('"\x[6211"', 'broken "\x[6211"');
eval_dies_ok('"\x [6211]"', 'broken "\x [6211]"');
@@ -27,6 +28,7 @@ is("\o[40]", ' ', '\o[40] normal space');
is("\o[240]", chr(160), '\o[240] non-breaking space');
is("\o[23072]", '', '\o[23072] wide hex character (SMILEY)');
is("\o[61021]", '', '\o[61021] wide hex character (Chinese char)');
+#?pugs 2 todo
eval_dies_ok('"\o[6211"', 'broken "\o[6211"');
eval_dies_ok('"\o [6211]"', 'broken "\o [6211]"');
@@ -41,6 +43,7 @@ is("\c[32]", ' ', '\c[32] normal space');
is("\c[160]", chr(160), '\c[240] non-breaking space');
is("\c[9786]", '', '\c[9786] wide hex character (SMILEY)');
is("\c[25105]", '', '\c[25105] wide hex character (Chinese char)');
+#?pugs 2 todo
eval_dies_ok('"\c[6211"', 'broken "\c[6211"');
eval_dies_ok('"\c [6211]"', 'broken "\c [6211]"');
@@ -55,6 +58,7 @@ is("\c65,66,67", 'A,66,67', '\clist not valid');
eval_dies_ok q{"\10"}, '"\10" form is no longer valid Perl 6';
}
+#?pugs skip '\040'
{
is "\040", "\x[0]40", '\0stuff is actually valid';
}
View
7 S02-literals/misc-interpolation.t
@@ -37,6 +37,7 @@ is("$number {$number}", '1 1', 'number inside and outside closure works');
is("$number {my $number=2}", '1 2', 'local version of number in closure works');
is("$number {my $number=2} $number", '1 2 1', 'original number still available after local version in closure: works' );
+#?pugs skip '?'
{
is "$(my $x = 2) $x", '2 2', 'Variable should interpolate and still be available in the outer scope.';
is("$(my $y = 2)" ~ $y, '22', 'Variable should interpolate and still be available in the outer scope.');
@@ -50,6 +51,7 @@ is("&func_w_args("foo","bar"))", '[foo][bar])', '"&func_w_args(...)" should inte
# L<S02/Method calls/"In order to interpolate the result of a method call">
is("$world.chars()", '5', 'method calls with parens should interpolate');
is("$world.chars", 'World.chars', 'method calls without parens should not interpolate');
+#?pugs skip '.flip'
is("$world.flip.chars()", '5', 'cascade of argumentless methods, last ending in paren');
is("$world.substr(0,1)", 'W', 'method calls with parens and args should interpolate');
@@ -70,11 +72,13 @@ is(qq{a{chr 98}c}, 'abc', "curly brace delimiters don't interfere with closure i
# Quoting constructs
# The next test will always succeed, but if there's a bug it probably
# won't compile.
+#?pugs 3 skip 'parsefail'
is(Q"abc\\d\\'\/", Q"abc\\d\\'\/", "raw quotation works");
is(q"abc\\d\"\'\/", Q|abc\d"\'\/|, "single quotation works"); #"
is(qq"abc\\d\"\'\/", Q|abc\d"'/|, "double quotation works"); #"
#?rakudo 3 skip 'qa qb and array/hash interpolation'
#?niecza skip 'No value for parameter \$index in postcircumfix:<[ ]>'
+#?pugs skip 'parsefail'
is(qa"$world @list[] %hash{}", Q"$world 1 2 %hash{}", "only interpolate array");
is(qb"$world \\\"\n\t", "\$world \\\"\n\t", "only interpolate backslash");
#?niecza skip 'No value for parameter \$index in postcircumfix:<[ ]>'
@@ -85,15 +89,18 @@ is(" \c[111] \c[107] ", ' o k ', "\\c[] respects whitespaces around it");
# L<S02/Radix interpolation/separating the numbers with comma:>
is("x \x[41,42,43] x", "x ABC x", "\\x[] allows multiple chars (1)");
is("x \x[41,42,00043] x", "x ABC x", "\\x[] allows multiple chars (2)"); #OK not indicate octal
+#?pugs todo
is("x \x[ 41, 42, 43 ] x", "x ABC x", "\\x[] allows multiple chars with white space");
is("x \c[65,66,67] x", "x ABC x", "\\c[] allows multiple chars (1)");
is("x \c[65,66,000067] x", "x ABC x", "\\c[] allows multiple chars (2)"); #OK not indicate octal
+#?pugs todo
is("x \c[ 65, 66, 67 ] x", "x ABC x", "\\c[] allows multiple chars with white space");
is("x \x[41,42,43]] x", "x ABC] x", "\\x[] should not eat following ]s");
is("x \c[65,66,67]] x", "x ABC] x", "\\c[] should not eat following ]s");
# L<S12/Fancy method calls/Within an interpolation, the double-quoted form>
+#?pugs skip 'parsefail'
{
class InterpolationTest {
method f { 'int' }
View
9 S02-literals/pairs.t
@@ -27,6 +27,7 @@ plan 79;
sub f1n (:$a) { $a.WHAT.gist }
sub f1p ( $a) { $a.WHAT.gist }
+#?pugs skip 'gist'
{
is f1n(a => 42), 'Int()', "'a => 42' is a named";
is f1n(:a(42)), 'Int()', "':a(42)' is a named";
@@ -71,6 +72,7 @@ sub f2 (:$a!) { WHAT($a) }
isa_ok $f2(:a), Bool, "in '\$f2(:a)', ':a' is a named";
isa_ok $f2.(:a), Bool, "in '\$f2.(:a)', ':a' is a named";
+ #?pugs 7 skip 'Missing required parameters'
dies_ok { f2("a" => 42) }, "'\"a\" => 42' is a pair";
dies_ok { f2(("a") => 42) }, "'(\"a\") => 42' is a pair";
dies_ok { f2((a => 42)) }, "'(a => 42)' is a pair";
@@ -79,6 +81,7 @@ sub f2 (:$a!) { WHAT($a) }
dies_ok { f2((:a)) }, "'(:a)' is a pair";
dies_ok { &f2.((:a)) }, 'in \'&f2.((:a))\', \'(:a)\' is a pair';
+ #?pugs 4 skip 'Missing required parameters'
dies_ok { $f2((:a)) }, "in '\$f2((:a))', '(:a)' is a pair";
dies_ok { $f2.((:a)) }, "in '\$f2.((:a))', '(:a)' is a pair";
dies_ok { $f2(((:a))) }, "in '\$f2(((:a)))', '(:a)' is a pair";
@@ -90,7 +93,7 @@ sub f3 ($a) { WHAT($a) }
my $pair = (a => 42);
isa_ok f3($pair), Pair, 'a $pair is not treated magically...';
- #?pugs todo '[,]'
+ ##?pugs todo '[,]'
#?rakudo skip 'prefix:<|>'
isa_ok f3(|$pair), Int, '...but |$pair is';
}
@@ -128,6 +131,7 @@ sub f6 ($a) { WHAT($a) }
}
sub f7 (:$bar!) { WHAT($bar) }
+#?pugs skip 'Missing required parameter'
{
my $bar = 'bar';
@@ -136,6 +140,7 @@ sub f7 (:$bar!) { WHAT($bar) }
}
sub f8 (:$bar!) { WHAT($bar) }
+#?pugs skip 'Missing required parameter'
{
my @array = <bar>;
@@ -144,6 +149,7 @@ sub f8 (:$bar!) { WHAT($bar) }
}
sub f9 (:$bar!) { WHAT($bar) }
+#?pugs skip 'Missing required parameter'
{
my $arrayref = <bar>;
@@ -151,6 +157,7 @@ sub f9 (:$bar!) { WHAT($bar) }
"variables cannot be keys of syntactical pairs (3)";
}
+#?pugs todo
{
is (a => 3).elems, 1, 'Pair.elems';
}
View
1  S03-operators/ternary.t
@@ -21,6 +21,7 @@ my $str3 = "bbb";
}
is(($str2 eq $str1 ?? 8 * 8 !! 9 * 9), 64, "?? !! in parenthesis");
+#?pugs skip 'div'
is(($str2 eq $str3 ?? 8 + 8 !! 9 div 9), 1, "?? !! in parenthesis");
is(1 ?? 2 ?? 3 !! 4 !! 5 ?? 6 !! 7, 3, "nested ?? !!");
View
20 S05-modifier/pos.t
@@ -16,8 +16,10 @@ plan 40;
for ("abcdef") {
ok(m:pos/abc/, "Matched 1: '$/'" );
+ #?pugs todo
is($/.to, 3, 'Interim position correct');
ok(m:pos/ghi|def/, "Matched 2: '$/'" );
+ #?pugs todo
is($/.to, 6, 'Final position correct');
}
@@ -26,9 +28,11 @@ for ("abcdef") {
$_ = "foofoofoo foofoofoo";
my $/;
ok(s:global:pos/foo/FOO/, 'Globally contiguous substitution');
+ #?pugs todo
is($_, "FOOFOOFOO foofoofoo", 'Correctly substituted contiguously');
}
+#?pugs todo
{
my $str = "abcabcabc";
my $/;
@@ -51,7 +55,9 @@ for ("abcdef") {
{
my $str = "abcabcabc";
my @x = $str ~~ m:i:g:p/abc/;
+ #?pugs todo
is("@x", "abc abc abc", 'Insensitive repeated continued match');
+ #?pugs todo
ok($/.to == 9, 'Insensitive repeated continued match pos');
ok ($str !~~ m:i:p/abc/, 'no more match, string exhausted');
@@ -59,6 +65,7 @@ for ("abcdef") {
#?rakudo skip "m:p:i:g// NYI"
#?niecza skip ':i'
+#?pugs todo
{
my $str = "abcabcabc";
my @x = ?($str ~~ m:p:i:g/abc/);
@@ -66,6 +73,7 @@ for ("abcdef") {
is($/.to, 3, 'Insensitive scalar repeated continued match pos');
}
+#?pugs skip 'Cannot parse regex'
{
my $str = "abcabcabc";
my $match = $str.match(/abc/, :p(0));
@@ -91,22 +99,34 @@ for ("abcdef") {
{
my $str = "abcabcabc";
my $match = $str.match(/abc/, :pos(0));
+ #?pugs skip 'coercion'
ok $match.Bool, "Match anchored to 0";
is $match.from, 0, "and the match is in the correct position";
+ #?pugs skip 'coercion'
nok $str.match(/abc/, :pos(1)).Bool, "No match anchored to 1";
+ #?pugs skip 'coercion'
nok $str.match(/abc/, :pos(2)).Bool, "No match anchored to 2";
$match = $str.match(/abc/, :pos(3));
+ #?pugs skip 'coercion'
ok $match.Bool, "Match anchored to 3";
+ #?pugs todo
is $match.from, 3, "and the match is in the correct position";
+ #?pugs skip 'coercion'
nok $str.match(/abc/, :pos(4)).Bool, "No match anchored to 4";
$match = $str.match(/abc/, :pos(6));
+ #?pugs skip 'coercion'
ok $match.Bool, "Match anchored to 6";
+ #?pugs todo
is $match.from, 6, "and the match is in the correct position";
+ #?pugs skip 'coercion'
nok $str.match(/abc/, :pos(7)).Bool, "No match anchored to 7";
+ #?pugs skip 'coercion'
nok $str.match(/abc/, :pos(8)).Bool, "No match anchored to 8";
+ #?pugs skip 'coercion'
nok $str.match(/abc/, :pos(9)).Bool, "No match anchored to 9";
+ #?pugs skip 'coercion'
nok $str.match(/abc/, :pos(10)).Bool, "No match anchored to 10";
}
View
9 S05-modifier/sigspace.t
@@ -11,17 +11,21 @@ Perl6::Rules, version 0.3 (12 Apr 2004), file t/word.t.
plan 11;
-#?pugs emit force_todo(3,4,5);
-
ok(!( "abc def" ~~ m/abc def/ ), 'Literal space nonmatch' );
+#?pugs todo
ok( "abcdef" ~~ m/abc def/, 'Nonspace match' );
+#?pugs todo
ok( "abc def" ~~ m:s/abc def/, 'Word space match' );
+#?pugs todo
ok( "abc\ndef" ~~ m:sigspace/abc def/, 'Word newline match' );
ok(!( "abcdef" ~~ m:sigspace/abc def/ ), 'Word nonspace nonmatch' );
+#?pugs todo
ok( "abc def" ~~ m:sigspace/abc <.ws> def/, 'Word explicit space match');
+#?pugs todo
ok 'abc def' ~~ m/:s abc def/, 'inline :s (+)';
ok 'zabc def' !~~ m/:s abc def/, 'inline :s implies <.ws> immediately (-)';
+#?pugs todo
ok 'zabc def' ~~ m/:s'abc' def/, 'inline :s implies <.ws> immediately (+)';
@@ -29,6 +33,7 @@ ok 'zabc def' ~~ m/:s'abc' def/, 'inline :s implies <.ws> immediately (+)';
#?rakudo 2 skip 'mm'
#?niecza 2 skip 'Action method quote:mm not yet implemented'
+#?pugs todo
ok 'abc def' ~~ mm/c d/, 'mm// works, implies :s (+)';
ok 'abcdef' !~~ mm/c d/, 'mm// works, implies :s (-)';
View
1  S06-signature/closure-over-parameters.t
@@ -23,6 +23,7 @@ sub factorial (Int $n) {
is factorial(0), 1, "closing over params of outer subs (0)";
is factorial(1), 1, "closing over params of outer subs (1)";
+#?pugs 2 todo
is factorial(2), 2, "closing over params of outer subs (2)";
is factorial(3), 6, "closing over params of outer subs (3)";
View
4 S06-signature/code.t
@@ -22,9 +22,11 @@ tester(sub ($x) { $collector = 3 * $x });
ok $collector == 12, 'same with anonymous sub';
sub tester2(&my_sub) { 1 } #OK not used
+#?pugs todo
dies_ok {eval 'tester2(42)' }, "can't pass thing that doesn't do Callable";
sub not_returns_a_sub { 3 };
+#?pugs todo
dies_ok { eval 'tester2(not_returns_a_sub)' },
"can't pass thing that doesn't do Callable";
@@ -32,6 +34,7 @@ is tester2({ 'block' }), 1, 'Can pass a block to a &parameter';
# RT #68578
#?niecza todo
+#?pugs todo
{
sub rt68578( Callable &x ) {} #OK not used
dies_ok { rt68578({ 'block' }) },
@@ -48,6 +51,7 @@ is tester2({ 'block' }), 1, 'Can pass a block to a &parameter';
#?rakudo todo 'RT 67932'
lives_ok { foo },
'can call a sub with a code object defaulting to something of its own name';
+ #?pugs todo
ok !$tracker.defined, 'the inner &foo is undefined (scoping)';
}
View
16 S32-num/stringify.t
@@ -6,10 +6,14 @@ plan 76;
#?DOES 4
sub Complex_str_test($value, $str_nucleus) {
+ #?pugs todo
is ~$value, $str_nucleus, "~<$str_nucleus>";
+ #?pugs skip 'coercion'
is $value.Str, $str_nucleus, "<$str_nucleus>.Str";
+ #?pugs skip '.gist'
is $value.gist, $str_nucleus, "<$str_nucleus>.gist";
#?rakudo todo 'Complex.perl'
+ #?pugs todo
is $value.perl, "<$str_nucleus>", "<$str_nucleus>.perl";
}
@@ -22,20 +26,26 @@ Complex_str_test (3.5 + 4i), '3.5+4i';
Complex_str_test (3 + 4.5i), '3+4.5i';
# infinities
Complex_str_test (Inf + 3i), 'Inf+3i';
+#?pugs skip 'parsefail'
Complex_str_test (0 + Inf\i), '0+Inf\i';
Complex_str_test (-Inf + 3i), '-Inf+3i';
+#?pugs skip 'parsefail'
Complex_str_test (0 - Inf\i), '0-Inf\i';
Complex_str_test (NaN + 3i), 'NaN+3i';
+#?pugs skip 'parsefail'
Complex_str_test (0 + NaN\i), '0+NaN\i';
# quick check that type objects stringify correctly - this has been a problem
# for Niecza in the past
+#?pugs skip 'gist'
is Complex.gist, 'Complex()', 'Complex.gist';
+#?pugs todo
is Complex.perl, 'Complex', 'Complex.perl';
# XXX Should ~Complex and Complex.Str return something specific? For now
# just make sure they don't die
lives_ok { ~Complex }, '~Complex does not die';
+#?pugs skip 'coercion'
lives_ok { Complex.Str }, 'Complex.Str does not die';
# L<S32::Numeric/Rat/"=item gist">
@@ -45,10 +55,13 @@ lives_ok { Complex.Str }, 'Complex.Str does not die';
# converters)
#?DOES 4
sub Rat_str_test($value, $str_nucleus) {
+ #?pugs 2 skip 'coercion'
is ~$value, ~$value.Num, "~<$str_nucleus>";
is $value.Str, ~$value.Num, "<$str_nucleus>.Str";
+ #?pugs skip '.gist'
is $value.gist, ~$value.Num, "<$str_nucleus>.gist";
#?rakudo todo 'Rat.perl'
+ #?pugs todo
is $value.perl, "<$str_nucleus>", "<$str_nucleus>.perl";
}
@@ -63,9 +76,12 @@ Rat_str_test 13/39, '1/3';
# Bignum sanity
Rat_str_test (4.5 ** 60), '1797010299914431210413179829509605039731475627537851106401/1152921504606846976';
+#?pugs skip '.gist'
is Rat.gist, 'Rat()', 'Rat.gist';
+#?pugs todo
is Rat.perl, 'Rat', 'Rat.perl';
lives_ok { ~Rat }, '~Rat does not die';
+#?pugs todo
lives_ok { Rat.Str }, 'Rat.Str does not die';
# TODO: FatRat, Num (once better specced), Int (maybe, but hard to mess up)
Please sign in to comment.
Something went wrong with that request. Please try again.