Skip to content

Commit 6467df2

Browse files
committed
test X::Attribute::Package and X::Attribute::NoPackage
1 parent 8988efd commit 6467df2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

S32-exceptions/misc.t

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ sub throws_like($code, $ex_type, *%matcher) {
2626
unless $ok {
2727
diag "Got: $got\n"
2828
~"Expected: $v";
29-
3029
}
3130
}
3231
} else {
3332
diag "Got: {$_.WHAT.gist}\n"
3433
~"Expected: {$ex_type.gist}";
34+
diag "Exception message: $_.message()";
3535
skip 'wrong exception type', %matcher.elems;
3636
}
3737
}
@@ -76,7 +76,7 @@ throws_like 'my class A { }; my class A { }', X::Redeclaration, symbol => 'A';
7676
throws_like 'my class B { }; my subset B { }', X::Redeclaration, symbol => 'B';
7777
throws_like 'CATCH { }; CATCH { }', X::Phaser::Multiple, block => 'CATCH';
7878

79-
throws_like 'class A { my @a; @a!List::foo() }',
79+
throws_like 'my class A { my @a; @a!List::foo() }',
8080
X::Method::Private::Permission,
8181
method => 'foo',
8282
calling-package => 'A',
@@ -135,4 +135,7 @@ throws_like 'self', X::Syntax::Self::WithoutObject;
135135
throws_like 'class { has $.x = $.y }', X::Syntax::VirtualCall, call => '$.y';
136136
throws_like '$.a', X::Syntax::NoSelf, variable => '$.a';
137137

138+
throws_like 'has $.x', X::Attribute::NoPackage;
139+
throws_like 'my module A { has $.x }', X::Attribute::Package, package-type => 'module';
140+
138141
done;

0 commit comments

Comments
 (0)