Browse files

skipped tests for X::Obsolete

  • Loading branch information...
1 parent 3d3f9a2 commit 4c68d1a505d5aa7e18b6135cc5ce767e36012fd3 @moritz moritz committed Dec 18, 2011
Showing with 11 additions and 4 deletions.
  1. +11 −4 S32-exceptions/misc.t
View
15 S32-exceptions/misc.t
@@ -1,7 +1,6 @@
use v6;
use Test;
-#?DOES 3
sub throws_like($code, $ex_type, *%matcher) {
if $code ~~ Callable {
$code()
@@ -13,9 +12,14 @@ sub throws_like($code, $ex_type, *%matcher) {
CATCH {
default {
ok 1, 'code died';
- ok $_.WHAT === $ex_type , "right exception type ({$ex_type.^name})";
- for %matcher.kv -> $k, $v {
- ok $_."$k"() ~~ $v, " .$k matches $v";
+ my $type_ok = $_.WHAT === $ex_type;
+ ok $type_ok , "right exception type ({$ex_type.^name})";
+ if $type_ok {
+ for %matcher.kv -> $k, $v {
+ ok $_."$k"() ~~ $v, " .$k matches $v";
+ }
+ } else {
+ skip 'wrong exception type', %matcher.elems;
}
}
}
@@ -27,4 +31,7 @@ throws_like 'class Foo { $!bar }', X::Attribute::Undeclared,
throws_like 'sub f() { $^x }', X::Signature::Placeholder,
line => 1;
+#?rakudo skip 'parsing of $& and other p5 variables'
+throws_like '$&', X::Obsolete, old => '$@ variable', new => '$/ or $()';
+
done;

0 comments on commit 4c68d1a

Please sign in to comment.