Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[t/spec] simplify a few tests to use /../ instead of rx/../

Also removed tests that referred to the Tuple type, which doesn't exist


git-svn-id: http://svn.pugscode.org/pugs@25576 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit 972b6e4fc428bc74a9b58317b556f418fde53e44 1 parent 9a049c7
moritz authored
21 S06-multi/type-based.t
View
@@ -1,6 +1,6 @@
use v6;
use Test;
-plan 30;
+plan 26;
# type based dispatching
#
@@ -23,8 +23,8 @@ is(foo(2), 'Int 2', 'dispatched to the Int sub');
my $num = '4';
is(foo(1.4), 'Num 1.4', 'dispatched to the Num sub');
is(foo(1 == 1), 'Bool 1', 'dispatched to the Bool sub');
-#?rakudo skip 'rx:P5'
-is(foo(rx:P5/a/),'Rule Rule','dispatched to the Rule sub');
+#?rakudo skip 'type Regex'
+is(foo(/a/),'Regex Regex','dispatched to the Rule sub');
is(foo(sub { 'baz' }), 'Sub baz', 'dispatched to the Sub sub');
my @array = ('foo', 'bar', 'baz');
@@ -35,21 +35,6 @@ is(foo(%hash), 'Hash bar, baz, foo', 'dispatched to the Hash sub');
is(foo($*ERR), 'IO', 'dispatched to the IO sub');
-#?pugs 4 todo "feature"
-#?rakudo 2 skip 'Null PMC access in find_method()'
-ok(eval('multi sub foo( (Int, Str) $tuple: ) '
- ~ '{ "Tuple(2) " ~ $tuple.join(",") }'),
- "declare sub with tuple argument");
-
-ok(eval('multi sub foo( (Int, Str, Str) $tuple: ) '
- ~ '{ "Tuple(3) " ~ $tuple.join(",") }'),
- "declare multi sub with tuple argument");
-
-# XXX isn't that just an Array nowadays?
-#?rakudo 2 todo '"No applicable methods"'
-is(foo([3, "Four"]), "Tuple(2) 3,Four", "call tuple multi sub");
-is(foo([3, "Four", "Five"]), "Tuple(3) 3,Four,Five", "call tuple multi sub");
-
# You're allowed to omit the "sub" when declaring a multi sub.
# L<S06/"Routine modifiers">
5 S29-hash/delete.t
View
@@ -42,9 +42,6 @@ ok !defined(%hash{"a"}), "deleted hash elements are really deleted";
{
my $a = 1;
- try { $a :delete; };
- # XXX do we really want to test against a specific error message?
- #?rakudo 1 skip "no rx:P5"
- like($!, rx:P5/Argument is not a Hash or Array element or slice/, "expected message for mis-use of delete");
+ eval_dies_ok '$a :delete', "Can't :delete a scalar";
}
5 S29-scalar/undef.t
View
@@ -253,13 +253,12 @@ Perl6-specific tests
ok(0 , "match values don't");
}
-#?rakudo skip 'rx:Perl5'
#?DOES 1
{
# - $0, $1 etc. should all be undef after a failed match
# (except for special circumstances)
- "abcde" ~~ rx:Perl5/(.)(.)(.)/;
- "abcde" ~~ rx:Perl5/(\d)/;
+ "abcde" ~~ /(.)(.)(.)/;
+ "abcde" ~~ /(\d)/;
ok((!try { grep { defined($_) }, ($0, $1, $2, $3, $4, $5) }),
"all submatches undefined after failed match") or
diag("match state: " ~ eval '$/');
11 S29-str/comb.t
View
@@ -2,13 +2,14 @@ use v6;
use Test;
-plan 24;
+plan 25;
# L<S29/Str/=item comb>
# comb Str
is "".comb, (), 'comb on empty string';
is "a bc d".comb, <a bc d>, 'default matcher and limit';
+is " a bc d ".comb, <a bc d>, 'default matcher and limit (leading/trailing ws)';
#?pugs todo 'feature'
#?rakudo skip 'limit for comb'
@@ -32,11 +33,10 @@ is "a bc d".comb(:limit(2)), <a bc>, 'default matcher with supplied limit';
is @list.join('|'), 'split|this|string', 'Str.comb';
}
-#?rakudo skip 'm:Perl5/../'
{
- is "a ab bc ad ba".comb(m:Perl5/\ba\S*/), <a ab ad>,
+ is "a ab bc ad ba".comb(/\ba\S*/), <a ab ad>,
'match for any a* words';
- is "a ab bc ad ba".comb(m:Perl5/\S*a\S*/), <a ab ad ba>,
+ is "a ab bc ad ba".comb(/\S*a\S*/), <a ab ad ba>,
'match for any *a* words';
}
@@ -48,8 +48,7 @@ is "a bc d".comb(:limit(2)), <a bc>, 'default matcher with supplied limit';
}
#?pugs todo 'feature'
-#?rakudo skip 'm:Perl5'
-is eval('"a ab bc ad ba".comb(m:Perl5/\S*a\S*/, 2)'), <a ab>, 'matcher and limit';
+is "a ab bc ad ba".comb(/\S*a\S*/, 2), <a ab>, 'matcher and limit';
is "forty-two".comb(/./).join('|'), 'f|o|r|t|y|-|t|w|o', q{Str.comb(/./)};
Please sign in to comment.
Something went wrong with that request. Please try again.