Permalink
Browse files

pugs fudge

  • Loading branch information...
1 parent 157d7b7 commit 9dac81d151349678483121c8124481c83d4ee3be @coke coke committed Mar 2, 2012
Showing with 142 additions and 40 deletions.
  1. +18 −0 S02-literals/quoting.t
  2. +16 −0 S02-types/bool.t
  3. +4 −0 S02-types/infinity.t
  4. +9 −1 S02-types/pair.t
  5. +1 −0 S04-declarations/multiple.t
  6. +1 −0 S04-phasers/end.t
  7. +2 −0 S06-other/anon-hashes-vs-blocks.t
  8. +9 −5 S32-list/grep.t
  9. +82 −34 S32-num/rat.t
View
@@ -42,6 +42,7 @@ Note that non-ASCII tests are kept in quoting-unicode.t
ok q{$x}.chars == 2, 'q{..} do not interpolate scalars';
}
+#?pugs skip 'parsefail'
{
is Q{\n}, '\n', 'Q{..} do not interpolate \n';
ok Q{\n}.chars == 2, 'Q{..} do not interpolate \n';
@@ -50,6 +51,7 @@ Note that non-ASCII tests are kept in quoting-unicode.t
is Q {\\}, '\\\\', 'Q {..} quoting';
}
+#?pugs skip 'parsefail'
{
ok Q{\\}.chars == 2, 'Q{..} do not interpolate backslashes';
}
@@ -97,6 +99,7 @@ Note that non-ASCII tests are kept in quoting-unicode.t
# L<S02/C<Q> forms/:q>
#?rakudo skip 'Q:q adverbs'
+#?pugs skip 'parsefail'
{ # adverb variation
my @q = ();
@q = (Q:q/$foo $bar/);
@@ -136,6 +139,7 @@ Note that non-ASCII tests are kept in quoting-unicode.t
# L<S02/C<Q> forms/:qq>
#?rakudo skip 'Q:qq adverbs'
+#?pugs skip 'parsefail'
{ # adverb variation
my @q = ();
@q = Q:qq/$foo $bar/;
@@ -167,6 +171,7 @@ Note that non-ASCII tests are kept in quoting-unicode.t
# quote with \0 as delimiters, forbidden by STD
# but see L<news:20050101220112.GF25432@plum.flirble.org>
#?rakudo skip 'retriage'
+#?pugs todo
{
eval_dies_ok "(q\0foo bar\0)";
}
@@ -329,6 +334,7 @@ FOO
is(@q[0], "yoink\\n\nsplort\\n\n", "backslashes");
}
+#?pugs skip 'parsefail'
{ # Q L<S02/Literals/No escapes at all>
my @q = ();
@@ -344,21 +350,25 @@ FOO
my @q = <<:p(1)>>;
#?rakudo 2 todo '<< :pair(1) >> (RT 65304)'
#?niecza todo
+ #?pugs todo
is(@q[0].perl, (:p(1)).perl, "pair inside <<>>-quotes - simple");
@q = <<:p(1) junk>>;
#?niecza todo
+ #?pugs todo
is(@q[0].perl, (:p(1)).perl, "pair inside <<>>-quotes - with some junk");
is(@q[1], 'junk', "pair inside <<>>-quotes - junk preserved");
@q = <<:def>>;
#?rakudo 2 todo '<< :pair(1) >>'
#?niecza todo
+ #?pugs todo
is(@q[0].perl, (def => 1).perl, ":pair in <<>>-quotes with no explicit value");
@q = "(eval failed)";
try { eval '@q = <<:p<moose>>>;' };
#?niecza todo
+ #?pugs todo
is(@q[0].perl, (p => "moose").perl, ":pair<anglequoted>");
};
@@ -407,6 +417,7 @@ Hello, World
}
# Q
+#?pugs skip 'Q'
{
my $s1 = "hello"; #OK not used
my $t1 = Q /$s1, world/;
@@ -419,6 +430,7 @@ Hello, World
# q:b
#?rakudo skip 'quoting adverbs'
+#?pugs skip 'parsefail'
{
my $t = q:b /\n\n\n/;
is $t, "\n\n\n", "Testing for q:b operator.";
@@ -454,13 +466,15 @@ Hello, World
#?rakudo skip 'q:x assigned to array'
#?niecza skip ':x'
+#?pugs todo
{
my @two_lines = q:x/echo hello ; echo world/;
is @two_lines, ("hello\n", "world\n"), 'testing q:x assigned to array';
}
#?rakudo skip 'q:x assigned to array'
#?niecza skip ':x'
+#?pugs todo
{
my $hello = 'howdy';
my @two_lines = qq:x/echo $hello ; echo world/;
@@ -535,6 +549,7 @@ Hello, World
# shorthands:
#?rakudo skip 'quoting adverbs'
#?niecza skip '& escape, zen slices'
+#?pugs skip 'parsefail'
{
my $alpha = 'foo';
my $beta = 'bar';
@@ -566,13 +581,16 @@ Hello, World
isa_ok rx:ignorecase{foo}, Regex, 'rx:i{...}';
isa_ok rx:s{foo}, Regex, 'rx:i{...}';
isa_ok rx:sigspace{foo}, Regex, 'rx:i{...}';
+ #?pugs todo
eval_dies_ok 'rx:unknown{foo}', 'rx:unknown dies';
+ #?pugs todo
eval_dies_ok 'rx:g{foo}', 'g does not make sense on rx//';
}
{
my $var = 'world';
is qx/echo world/.chomp, "world", 'qx';
+ #?pugs skip 'multi ok'
is qqx/echo $var/.chomp, "world", 'qqx';
# RT #78874
is qx/echo world/.trans('wd' => 'WD'), "WorlD\n", "qx doesn't return a Parrot string";
View
@@ -16,8 +16,10 @@ $a = Bool::False;
isa_ok($a, Bool);
# tests that Bool.Bool works
+#?pugs 2 skip "Bool"
isa_ok (Bool::True).Bool, Bool, "Bool.Bool is a Bool";
isa_ok (Bool::False).Bool, Bool, "Bool.Bool is a Bool";
+#?pugs 2 skip "coercion"
is (Bool::True).Bool, Bool::True, "Bool.Bool works for True";
is (Bool::False).Bool, Bool::False, "Bool.Bool works for False";
@@ -28,6 +30,7 @@ is ?(Bool::True), Bool::True, "?Bool works for True";
is ?(Bool::False), Bool::False, "?Bool works for False";
# tests they work with && and ||
+#?pugs 4 skip 'pass'
Bool::True && pass('True works');
Bool::False || pass('False works');
@@ -44,21 +47,27 @@ ok(!Bool::False, 'False works');
# tests Bool stringification - interaction with ~
isa_ok(~Bool::True, Str);
isa_ok(~Bool::False, Str);
+#?pugs 2 todo "stringification"
is(~Bool::True, 'True', 'Bool stringification (True)');
is(~Bool::False, 'False', 'Bool stringification (False)');
+#?pugs 2 skip "coercion"
is Bool::True.Str, 'True', 'True.Str';
is Bool::False.Str, 'False', 'False.Str';
+#?pugs 2 skip "gist"
is Bool::True.gist, 'True', 'True.gist';
is Bool::False.gist, 'False', 'False.gist';
is Bool::True.perl, 'Bool::True', 'True.perl';
is Bool::False.perl, 'Bool::False', 'False.perl';
# numification - interaction with +
+#?pugs 2 skip "Numeric"
ok(+Bool::True ~~ Numeric);
ok(+Bool::False ~~ Numeric);
+#?pugs 2 skip "Int"
isa_ok(+Bool::True, Int, 'True numifies to an Int');
isa_ok(+Bool::False, Int, 'False numifies to an Int');
+#?pugs 2 skip "coercion"
is(Bool::True.Int, '1', 'True Intifies to 1');
is(Bool::False.Int, '0', 'False Intifies to 1');
@@ -68,23 +77,30 @@ is(+Bool::False, '0', 'False numifies to 0');
# Arithmetic operations
my $bool = Bool::False;
is(++$bool, Bool::True, 'Increment of Bool::False produces Bool::True');
+#?pugs todo
is(++$bool, Bool::True, 'Increment of Bool::True still produces Bool::True');
+#?pugs skip 'Cannot cast from VBool True to VCode'
is(--$bool, Bool::False, 'Decrement of Bool::True produces Bool::False');
+#?pugs todo
is(--$bool, Bool::False, 'Decrement of Bool::False produces Bool::False');
# RT #65514
{
+ #?pugs 2 skip 'Cannot cast from VBool True to VCode'
ok (0 but Bool::True), 'Bool::True works with "but"';
is (0 but Bool::True), 0, 'Bool::True works with "but"';
+ #?pugs 2 skip 'Cannot cast from VBool False to VCode'
ok !('RT65514' but Bool::False), 'Bool::False works with "but"';
is ('RT65514' but Bool::False), 'RT65514', 'Bool::False works with "but"';
}
+#?pugs skip '.key'
{
is Bool::True.key, 'True', 'Bool::True.key works (is "True")';
is Bool::False.key, 'False', 'Bool::False.key works (is "False")';
}
+#?pugs skip '.pick'
{
my $x = Bool.pick;
ok ($x === True || $x === False), 'Bool.pick return True or False';
View
@@ -21,13 +21,15 @@ plan 13;
{
my $x = Inf.Int;
ok( $x == Inf, 'int numeric equal' );
+ #?pugs todo
ok( $x eq 'Inf', 'int string equal' );
}
#?rakudo skip 'integer Inf'
{
my $x = ( -Inf ).Int;
ok( $x == -Inf, 'int numeric equal' );
+ #?pugs todo
ok( $x eq '-Inf', 'int string equal' );
}
@@ -39,13 +41,15 @@ plan 13;
# Inf eq Inf # same as
# ~Inf eq ~Inf # true
+#?pugs 4 todo
ok truncate(Inf) ~~ Inf, 'truncate(Inf) ~~ Inf';
#?rakudo 3 todo 'Int conversion of NaN and Inf'
ok NaN.Int === NaN, 'Inf.Int === Int';
ok Inf.Int === Inf, 'Inf.Int === Int';
ok (-Inf).Int === (-Inf), 'Inf.Int === Int';
# RT #70730
+#?pugs skip 'parsefail'
{
ok ( rand * Inf ) === Inf, 'multiply rand by Inf without maximum recursion depth exceeded';
}
View
@@ -82,14 +82,16 @@ is($quux.key, 'quux', "lhs quotes" );
{
my $pair = :when<now>;
#?rakudo todo 'should it really have \n on the end?'
+ #?pugs todo
is ~(%($pair)), "when\tnow\n", 'hash stringification';
# hold back this one according to audreyt
#ok $pair.does(Hash), 'Pair does Hash';
- #?pugs TODO "bug"
+ #?pugs todo
ok (%($pair) ~~ Hash), '%() makes creates a real Hash';
}
# colonpair syntax
+#?pugs skip 'colonpair'
{
is(:foo.key, 'foo', 'got the right key :foo.key');
isa_ok(:foo.value, Bool, ':foo.value isa Bool');
@@ -146,8 +148,10 @@ test2 %hash;
sub test3 (%h){
for %h.pairs -> $pair {
isa_ok($pair,Pair);
+ #?pugs todo
isa_ok($pair[0], Pair, 'sub test3: $pair[0] is $pair');
#?niecza skip "Failure NYI"
+ #?pugs skip "Failure NYI"
ok $pair[1] ~~ Failure, 'sub test3: $pair[1] is failure';
}
}
@@ -291,6 +295,7 @@ Note, "non-chaining binary" was later renamed to "structural infix".
my %hash = foo => 'bar', baz => 'qux';
$pair = (:%hash);
+ #?pugs todo
ok($pair eqv (hash => %hash), ':%foo syntax works');
}
@@ -310,12 +315,15 @@ Note, "non-chaining binary" was later renamed to "structural infix".
lives_ok {; :a[] }, 'can execute ":a[]"';
eval_lives_ok '(a => ())', 'can parse "(a => ())"';
+ #?pugs skip 'Cannot cast from VList to VCode'
lives_ok { (a => ()) }, 'can execute "(a => ())"';
eval_lives_ok '(a => [])', 'can parse "(a => [])"';
+ #?pugs skip 'Cannot cast from VList to VCode'
lives_ok { (a => []) }, 'can execute "(a => [])"';
}
+#?pugs skip ".invert"
{
is (a => 3).invert.key, 3, 'Pair.invert.key';
isa_ok (a => 3).invert.key, Int, 'Pair.invert.key type';
@@ -22,6 +22,7 @@ eval_lives_ok 'state $x; state $x',
}
# this is not exactly S04 material
+#?pugs todo
eval_dies_ok 'sub foo {1; }; sub foo($x) {1; };',
'multiple declarations need multi or proto';
View
@@ -13,6 +13,7 @@ eval_lives_ok 'my $x = 3; END { $a = $x * $x };',
'and those from eval as well';
#?niecza todo
+#?pugs todo
is $a, 9, 'and they really worked';
# vim: ft=perl6
@@ -33,6 +33,7 @@ ok $bar ~~ Hash, '%foo in a block causes hash composing';
%hash<bar> //= hash;
my $h_ref;
$h_ref //= hash();
+ #?pugs 3 skip 'gist'
is(%hash<foo>.WHAT.gist, ::Hash.gist, "Parses as two items");
is(%hash<bar>.WHAT.gist, ::Hash.gist, "Parens do not help");
is($h_ref.WHAT.gist, ::Hash.gist, "It is not limited to hash values");
@@ -41,6 +42,7 @@ ok $bar ~~ Hash, '%foo in a block causes hash composing';
{
ok {; a => 1 } ~~ Block, '{; ... } is a Block';
ok { a => 1 } ~~ Hash, '{ a => 1} is a Hash';
+ #?pugs 4 skip "Missing required parameters"
ok { $^a => $^b } ~~ Block, 'placeholders force it to be a block';
ok { $^a => 'b' } ~~ Block, '... as a key';
ok { a => $^x } ~~ Block, '... as a value';
Oops, something went wrong.

0 comments on commit 9dac81d

Please sign in to comment.