@@ -26,12 +26,12 @@ sub throws_like($code, $ex_type, *%matcher) {
26
26
unless $ ok {
27
27
diag " Got: $ got\n "
28
28
~ " Expected: $ v" ;
29
-
30
29
}
31
30
}
32
31
} else {
33
32
diag " Got: { $ _ . WHAT . gist } \n "
34
33
~ " Expected: { $ ex_type . gist } " ;
34
+ diag " Exception message: $ _. message ()" ;
35
35
skip ' wrong exception type' , % matcher . elems ;
36
36
}
37
37
}
@@ -76,7 +76,7 @@ throws_like 'my class A { }; my class A { }', X::Redeclaration, symbol => 'A';
76
76
throws_like ' my class B { }; my subset B { }' , X::Redeclaration , symbol => ' B' ;
77
77
throws_like ' CATCH { }; CATCH { }' , X::Phaser::Multiple , block => ' CATCH' ;
78
78
79
- throws_like ' class A { my @a; @a!List::foo() }' ,
79
+ throws_like ' my class A { my @a; @a!List::foo() }' ,
80
80
X::Method::Private::Permission ,
81
81
method => ' foo' ,
82
82
calling-package => ' A' ,
@@ -135,4 +135,7 @@ throws_like 'self', X::Syntax::Self::WithoutObject;
135
135
throws_like ' class { has $.x = $.y }' , X::Syntax::VirtualCall , call => ' $.y' ;
136
136
throws_like ' $.a' , X::Syntax::NoSelf , variable => ' $.a' ;
137
137
138
+ throws_like ' has $.x' , X::Attribute::NoPackage ;
139
+ throws_like ' my module A { has $.x }' , X::Attribute::Package , package-type => ' module' ;
140
+
138
141
done ;
0 commit comments