Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
pugs (un)fudge
  • Loading branch information
coke committed Jul 18, 2012
1 parent 48446cb commit f200e0a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
1 change: 1 addition & 0 deletions S03-smartmatch/hash-hash.t
Expand Up @@ -14,6 +14,7 @@ my %hash5 = ( "foo" => 1, "bar" => 1, "gorch" => Mu, "baz" => Mu );
{
#?rakudo todo 'nom regression'
#?niecza todo
#?pugs todo
ok (%hash1 ~~ %hash2), 'Hash ~~ Hash (same keys, +)';
ok !(%hash1 ~~ %hash3), 'Hash ~~ Hash (same keys, -)';
#?pugs todo
Expand Down
22 changes: 20 additions & 2 deletions S05-interpolation/regex-in-variable.t
Expand Up @@ -12,7 +12,6 @@ plan 29;

# L<S05/Variable (non-)interpolation>

#?pugs emit force_todo(3,4,5,6,7,9,10,11,13,14,15)

my $var = rx/a+b/;

Expand All @@ -28,18 +27,26 @@ my @foo = ("a+b", "b+c");

ok(!( "a+b" ~~ m/<{$var}>/ ), 'Simple scalar match 1');
ok(!( "a+b" ~~ m/<$var>/ ), 'Simple scalar match 2');
#?pugs todo
ok("a+b" ~~ m/$foo/, 'Simple scalar match 3');
ok(!( "zzzzzza+bzzzzzz" ~~ m/<{$var}>/ ), 'Nested scalar match 1');
ok(!( "zzzzzza+bzzzzzz" ~~ m/<$var>/ ), 'Nested scalar match 2');
#?pugs todo
ok("zzzzzza+bzzzzzz" ~~ m/$foo/ , 'Nested scalar match 3');
#?pugs todo
ok("aaaaab" ~~ m/<{$var}>/, 'Rulish scalar match 1');
#?pugs todo
ok("aaaaab" ~~ m/<$var>/, 'Rulish scalar match 2');
#?pugs todo
ok("aaaaab" ~~ m/$var/, 'Rulish scalar match 3');
#?pugs todo
ok("aaaaab" ~~ m/<{$foo}>/, 'Rulish scalar match 4');
#?pugs todo
ok("aaaaab" ~~ m/<$foo>/, 'Rulish scalar match 5');
ok(!("aaaaab" ~~ m/$foo/), 'Rulish scalar match 6');

# RT #61960
#?pugs todo
{
my $a = 'a';
ok 'a' ~~ / $a /, 'match with string as rx works';
Expand All @@ -48,32 +55,43 @@ ok(!("aaaaab" ~~ m/$foo/), 'Rulish scalar match 6');
# Arrays

#?rakudo 4 todo 'array of regexes'
#?pugs todo
ok("a" ~~ m/@var/, 'Simple array match (a)');
#?pugs todo
ok("b" ~~ m/@var/, 'Simple array match (b)');
#?pugs todo
ok("c" ~~ m/@var/, 'Simple array match (c)');
#?pugs todo
ok("d" ~~ m/@var/, 'Simple array match (d)');
ok(!( "!" ~~ m/@var/ ), 'Simple array match (!)');
#?rakudo 3 todo 'array variable interpolation'
#?pugs todo
ok("!!!!a!!!!!" ~~ m/@var/, 'Nested array match (a)');
#?pugs todo
ok("!!!!e!!!!!" ~~ m/@var/, 'Nested array match (e)');

#?pugs todo
ok("abca" ~~ m/^@var+$/, 'Multiple array matching');
#?niecza skip 'Cannot cast from source type to destination type.'
#?niecza skip 'Cannot cast from source type to destination type.'|
ok(!( "abca!" ~~ m/^@var+$/ ), 'Multiple array non-matching');

#?rakudo todo 'array variable interpolation'
#?pugs todo
ok("a+bb+ca+b" ~~ /^@foo+$/, 'Multiple array non-compiling');
ok(!("a+bb+ca+b" ~~ /^<@foo>+$/), 'Multiple array compiling');
ok(!("aaaabbbbbcaaab" ~~ /^@foo+$/), 'Multiple array non-compiling');
#?pugs todo
#?rakudo todo 'nom regression'
ok("aaaabbbbbcaaab" ~~ /^<@foo>+$/, 'Multiple array compiling');

# L<S05/Variable (non-)interpolation/The use of a hash variable in patterns is reserved>
#?pugs todo
eval_dies_ok 'm/%var/', 'cannot interpolate hashes into regexes';

# L<S05/Variable (non-)interpolation/If $var is undefined>
# This is similar to a test in S05-match/capturing-contexts.t
#?niecza skip 'Object reference not set to an instance of an object'
#?pugs skip 'boom'
{
my $u;
ok 'a' !~~ /$u/, 'undefined variable does not match';
Expand Down
1 change: 0 additions & 1 deletion integration/99problems-11-to-20.t
Expand Up @@ -159,7 +159,6 @@ plan 25;
#?niecza skip 'Feed ops NYI'
{
my @result = eval '<a b c c d> ==> map { $_ xx 2 }';
#?pugs todo 'feed ops'
is @result, <a a b b c c c c d d>,
'We should be able to duplicate the elements of a list';
}
Expand Down
7 changes: 1 addition & 6 deletions integration/class-name-and-attribute-conflict.t
Expand Up @@ -75,7 +75,6 @@ plan 3;
method update { $var -= $.a; }
};
a.new( a => 10 ).update;
#?pugs todo 'bug'
is $var, 90, "Testing suite 1.";
}

Expand All @@ -97,14 +96,12 @@ plan 3;
submethod BUILD { _a.new( _a => $._a ).update; };
};

#?pugs emit #
_b.new( _a => 20 );
#?pugs todo 'bug'
is $var, 80, "Testing suite 2.";
}



#?pugs skip 'No such method in class Ac: "&update"'
{
my $var = 100;
# XXX This definition *does* have an effect. This $var *is* captured.
Expand All @@ -123,9 +120,7 @@ plan 3;
submethod BUILD { Ab.new( Aa => $.Ab ); }
};

#?pugs emit #
Ac.new( Ab => 30 ).update;
#?pugs todo 'bug'
is $var, 70, "Testing suite 3.";
}

Expand Down
1 change: 0 additions & 1 deletion integration/role-composition-vs-attribute.t
Expand Up @@ -20,7 +20,6 @@ class S does B
}

# uncomment below after the bug is fixed. As below line will cause infinite loop;
#?pugs skip 'bug'
is S.new.x, 3, "Test class inhrited from the same role caused infinite loop bug";

# vim: ft=perl6

0 comments on commit f200e0a

Please sign in to comment.