Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 278 lines (234 sloc) 12.234 kb
3d3f9a2 Moritz Lenz initial tests for typed exceptions; very unstructured for now
moritz authored
1 use v6;
2 use Test;
3
2002a2f Moritz Lenz more typed exceptions
moritz authored
4 #?DOES 1
3d3f9a2 Moritz Lenz initial tests for typed exceptions; very unstructured for now
moritz authored
5 sub throws_like($code, $ex_type, *%matcher) {
6ff177c Moritz Lenz even nicer test output
moritz authored
6 my $msg;
3d3f9a2 Moritz Lenz initial tests for typed exceptions; very unstructured for now
moritz authored
7 if $code ~~ Callable {
6ff177c Moritz Lenz even nicer test output
moritz authored
8 $msg = 'code dies';
3d3f9a2 Moritz Lenz initial tests for typed exceptions; very unstructured for now
moritz authored
9 $code()
10 } else {
6ff177c Moritz Lenz even nicer test output
moritz authored
11 $msg = "'$code' died";
3d3f9a2 Moritz Lenz initial tests for typed exceptions; very unstructured for now
moritz authored
12 eval $code;
13 }
6ff177c Moritz Lenz even nicer test output
moritz authored
14 ok 0, $msg;
3d3f9a2 Moritz Lenz initial tests for typed exceptions; very unstructured for now
moritz authored
15 skip 'Code did not die, can not check exception', 1 + %matcher.elems;
16 CATCH {
17 default {
6ff177c Moritz Lenz even nicer test output
moritz authored
18 ok 1, $msg;
d9262ef Moritz Lenz [throws_ok] allow subtypes; Liskov applies
moritz authored
19 my $type_ok = $_ ~~ $ex_type;
4c68d1a Moritz Lenz skipped tests for X::Obsolete
moritz authored
20 ok $type_ok , "right exception type ({$ex_type.^name})";
21 if $type_ok {
22 for %matcher.kv -> $k, $v {
8d41f56 Moritz Lenz more typed exception tests, better diagnosis
moritz authored
23 my $got = $_."$k"();
24 my $ok = $got ~~ $v,;
5e0af50 Moritz Lenz [throws_like] avoid undef warnings for matchers
moritz authored
25 ok $ok, ".$k matches {$v.defined ?? $v !! $v.gist}";
8d41f56 Moritz Lenz more typed exception tests, better diagnosis
moritz authored
26 unless $ok {
27 diag "Got: $got\n"
28 ~"Expected: $v";
29 }
4c68d1a Moritz Lenz skipped tests for X::Obsolete
moritz authored
30 }
31 } else {
8d41f56 Moritz Lenz more typed exception tests, better diagnosis
moritz authored
32 diag "Got: {$_.WHAT.gist}\n"
33 ~"Expected: {$ex_type.gist}";
6467df2 Moritz Lenz test X::Attribute::Package and X::Attribute::NoPackage
moritz authored
34 diag "Exception message: $_.message()";
4c68d1a Moritz Lenz skipped tests for X::Obsolete
moritz authored
35 skip 'wrong exception type', %matcher.elems;
3d3f9a2 Moritz Lenz initial tests for typed exceptions; very unstructured for now
moritz authored
36 }
37 }
38 }
39 }
40
88dbaa7 Moritz Lenz X::Buf::Pack
moritz authored
41 throws_like { Buf.new().Str }, X::Buf::AsStr, method => 'Str';;
42 throws_like 'pack("B", 1)', X::Buf::Pack, directive => 'B';
43 throws_like 'Buf.new.unpack("B")', X::Buf::Pack, directive => 'B';
6763664 Moritz Lenz fix test for X::Attribute::Undeclared
moritz authored
44 throws_like 'my class Foo { method a() { $!bar } }', X::Attribute::Undeclared,
3d3f9a2 Moritz Lenz initial tests for typed exceptions; very unstructured for now
moritz authored
45 name => '$!bar', package-name => 'Foo';
46 throws_like 'sub f() { $^x }', X::Signature::Placeholder,
47 line => 1;
48
4c68d1a Moritz Lenz skipped tests for X::Obsolete
moritz authored
49 #?rakudo skip 'parsing of $& and other p5 variables'
9fb1b22 Moritz Lenz test for qr obsoletion message
moritz authored
50 throws_like '$&', X::Obsolete, old => '$@ variable', replacement => '$, rx/<<rx>>// or $()';
51 throws_like 'qr/a/', X::Obsolete, old => rx/<<qr>>/, replacement => rx/<<rx>>/;
4c68d1a Moritz Lenz skipped tests for X::Obsolete
moritz authored
52
f52c2ed Moritz Lenz test presence of placeholder attribute of X::Placeholder::Block exceptio...
moritz authored
53 throws_like 'do { $^x }', X::Placeholder::Block, placeholder => '$^x';
54 throws_like 'do { @_ }', X::Placeholder::Block, placeholder => '@_';
55 throws_like 'class { $^x }', X::Placeholder::Block, placeholder => '$^x';
8d41f56 Moritz Lenz more typed exception tests, better diagnosis
moritz authored
56 throws_like '$^x', X::Placeholder::Mainline, placeholder => '$^x';
d5ac5a6 Moritz Lenz RT #73502, @_ in the mainline
moritz authored
57 # RT #73502
58 throws_like '@_', X::Placeholder::Mainline, placeholder => '@_';
bea87e2 Moritz Lenz RT #85942
moritz authored
59 # RT #85942
60 throws_like '"foo".{ say $^a }', X::Placeholder::Mainline;
61
62
8d41f56 Moritz Lenz more typed exception tests, better diagnosis
moritz authored
63 throws_like 'sub f(*@a = 2) { }', X::Parameter::Default, how => 'slurpy';
64 throws_like 'sub f($x! = 3) { }', X::Parameter::Default, how => 'required';
65 throws_like 'sub f(:$x! = 3) { }', X::Parameter::Default, how => 'required';
66 throws_like 'sub f($:x) { }', X::Parameter::Placeholder,
67 parameter => '$:x',
68 right => ':$x';
69 throws_like 'sub f($?x) { }', X::Parameter::Twigil,
70 parameter => '$?x',
71 twigil => '?';
a97dc2a Moritz Lenz track change of error class names; add some more redeclaration tests
moritz authored
72 throws_like 'sub (Int Str $x) { }', X::Parameter::MultipleTypeConstraints;
8d41f56 Moritz Lenz more typed exception tests, better diagnosis
moritz authored
73
74
75
a97dc2a Moritz Lenz track change of error class names; add some more redeclaration tests
moritz authored
76 # some of these redeclaration errors take different code
77 # paths in rakudo, so we over-test a bit to catch them all,
78 # even if the tests look rather boring;
0b7d7d2 Moritz Lenz more typed exception tests
moritz authored
79 throws_like 'my @a; my @a', X::Redeclaration, symbol => '@a';
80 throws_like 'sub a { }; sub a { }',X::Redeclaration, symbol => 'a', what => 'routine';
dddf111 Moritz Lenz RT #78370, my &a; sub a { } redeclaration error
moritz authored
81 # RT #78370
cf0e342 Moritz Lenz oops, meant to test something else
moritz authored
82 #?rakudo skip 'RT 78370'
83 throws_like 'my &a; multi a { }', X::Redeclaration, symbol => 'a', what => 'routine';
63626c2 Moritz Lenz another redeclaration test
moritz authored
84 throws_like 'sub a { }; multi sub a { }',X::Redeclaration, symbol => 'a', what => 'routine';
a97dc2a Moritz Lenz track change of error class names; add some more redeclaration tests
moritz authored
85 throws_like 'my class A { }; my class A { }', X::Redeclaration, symbol => 'A';
c9e3611 Moritz Lenz more robust name clash tests
moritz authored
86 throws_like 'my class B { }; my subset B of Any;', X::Redeclaration, symbol => 'B';
a97dc2a Moritz Lenz track change of error class names; add some more redeclaration tests
moritz authored
87 throws_like 'CATCH { }; CATCH { }', X::Phaser::Multiple, block => 'CATCH';
fbb78ed Moritz Lenz test for X::Placeholder::Block
moritz authored
88
6467df2 Moritz Lenz test X::Attribute::Package and X::Attribute::NoPackage
moritz authored
89 throws_like 'my class A { my @a; @a!List::foo() }',
c01e5d6 Moritz Lenz tests for typed private method call exceptions
moritz authored
90 X::Method::Private::Permission,
91 method => 'foo',
92 calling-package => 'A',
93 source-package => 'List';
94
95 throws_like '1!foo()',
a97dc2a Moritz Lenz track change of error class names; add some more redeclaration tests
moritz authored
96 X::Method::Private::Unqualified,
c01e5d6 Moritz Lenz tests for typed private method call exceptions
moritz authored
97 method => 'foo';
98
d9262ef Moritz Lenz [throws_ok] allow subtypes; Liskov applies
moritz authored
99 throws_like 'sub f() { }; f() := 2', X::Bind;
100 throws_like 'OUTER := 5', X::Bind, target => /OUTER/;
a824698 Moritz Lenz typed binding excpetions
moritz authored
101 throws_like 'my int $x := 2', X::Bind::NativeType;
c6df8c5 Moritz Lenz update and expand tests for binding to unbindable stuff
moritz authored
102 throws_like 'my @a; @a[] := <foo bar baz>', X::Bind::ZenSlice, type => Array;
103 throws_like 'my %a; %a{} := foo=>1, bar=>2, baz=>3', X::Bind::ZenSlice, type => Hash;
104 throws_like 'my @a; @a[0, 1] := (2, 3)', X::Bind::Slice, type => Array;
105 throws_like 'my %a; %a<a b> := (2, 3)', X::Bind::Slice, type => Hash;
709242e timo tests for X::Bind::ZenSlice.
timo authored
106
a824698 Moritz Lenz typed binding excpetions
moritz authored
107
dc765eb Moritz Lenz tests for typed exceptions
moritz authored
108 throws_like 'for (1; 1; 1) { }', X::Obsolete,
109 old => rx/<<for>>/,
110 replacement => rx/<<loop>>/;
111 throws_like 'foreach (1..10) { }', X::Obsolete,
112 old => "'foreach'",
113 replacement => "'for'";
114 throws_like 'undef', X::Obsolete,
115 old => rx/<<undef>>/;
116
a97dc2a Moritz Lenz track change of error class names; add some more redeclaration tests
moritz authored
117 throws_like 'my $a::::b', X::Syntax::Name::Null;
d1f0fd8 Moritz Lenz tests for typed syntax errors
moritz authored
118 throws_like 'unless 1 { } else { }', X::Syntax::UnlessElse;
119 throws_like 'for my $x (1, 2, 3) { }', X::Syntax::P5;
120 throws_like ':!foo(3)', X::Syntax::NegatedPair;
121 throws_like 'my $0', X::Syntax::Variable::Numeric;
b291479 Moritz Lenz test parameter variant of X::Syntax::Variable::Numeric
moritz authored
122 throws_like 'my sub f($0) { }', X::Syntax::Variable::Numeric, what => 'parameter';
d1f0fd8 Moritz Lenz tests for typed syntax errors
moritz authored
123 throws_like 'my $<a>', X::Syntax::Variable::Match;
33e961e Moritz Lenz RT #69230, my $!foo
moritz authored
124 throws_like 'my class A { my $!foo }', X::Syntax::Variable::Twigil, twigil => '!', scope => 'my';
d9f7caa Moritz Lenz RT #112724, line numbers from warnings
moritz authored
125 throws_like 'my $?FILE', X::Syntax::Variable::Twigil, twigil => '?', scope => 'my';
277e13d Moritz Lenz more tests for typed syntax errors
moritz authored
126 throws_like 'my $::("foo")', X::Syntax::Variable::IndirectDeclaration;
171ad0a Moritz Lenz test X::Undeclared
moritz authored
127 throws_like '@a', X::Undeclared, symbol => '@a';
277e13d Moritz Lenz more tests for typed syntax errors
moritz authored
128 throws_like 'augment class Any { }', X::Syntax::Augment::WithoutMonkeyTyping;
129 throws_like 'use MONKEY_TYPING; augment role Positional { }', X::Syntax::Augment::Role;
fd201d9 Moritz Lenz RT #82984
moritz authored
130 throws_like 'sub postbla:sym<foo>() { }', X::Syntax::Extension::Category, category => 'postbla';
ab9c613 Moritz Lenz RT #83992, proper error message for infix in term position
moritz authored
131 # RT #83992
132 throws_like 'my @a = 1, => 2', X::Syntax::InfixInTermPosition, infix => '=>';
840bfda Moritz Lenz test for X::Signature::NameClash
moritz authored
133 throws_like 'sub f(:in(:$in)) { }', X::Signature::NameClash, name => 'in';
296a529 timo test for X::Does::TypeObject raising for 'does' operator.
timo authored
134 throws_like 'my $foo does &Int', X::Does::TypeObject;
135 throws_like 'my $foo does &Int, &Bool', X::Does::TypeObject;
104f522 timo add tests for X::Role::Initialization.
timo authored
136 throws_like 'role R { }; 99 but R("wrong");', X::Role::Initialization;
137 throws_like 'role R { has $.x; has $.y }; 99 but R("wrong");', X::Role::Initialization;
138 throws_like 'role R { }; 99 does R("wrong");', X::Role::Initialization;
139 throws_like 'role R { has $.x; has $.y }; 99 does R("wrong");', X::Role::Initialization;
277e13d Moritz Lenz more tests for typed syntax errors
moritz authored
140
141 throws_like 'sub f($a?, $b) { }', X::Parameter::WrongOrder,
142 misplaced => 'required',
143 after => 'optional';
144 throws_like 'sub f(*@a, $b) { }', X::Parameter::WrongOrder,
145 misplaced => 'required',
146 after => 'variadic';
147 throws_like 'sub f(*@a, $b?) { }', X::Parameter::WrongOrder,
148 misplaced => 'optional positional',
149 after => 'variadic';
03faea7 Moritz Lenz X::Syntax::Name::NotNull
moritz authored
150
2002a2f Moritz Lenz more typed exceptions
moritz authored
151 #?rakudo skip 'parsing regression'
152 throws_like '#`', X::Syntax::Comment::Embedded;
1af5f7a Moritz Lenz RT #71814, =begin without identifier
moritz authored
153 # RT #71814
154 throws_like "=begin\n", X::Syntax::Pod::BeginWithoutIdentifier, line => 1, filename => rx/eval/;
2002a2f Moritz Lenz more typed exceptions
moritz authored
155
156 throws_like '@', X::Syntax::SigilWithoutName;
157 throws_like '1∞', X::Syntax::Confused;
e4dee67 Moritz Lenz X::Syntax::Missing
moritz authored
158 throws_like 'for 1, 2', X::Syntax::Missing, what => 'block';
a78af8c Moritz Lenz X::Syntax::Reserved
moritz authored
159 throws_like 'my @a()', X::Syntax::Reserved, reserved => /shape/ & /array/;
160 throws_like 'my &a()', X::Syntax::Reserved, instead => /':()'/;
2002a2f Moritz Lenz more typed exceptions
moritz authored
161
59f3f35 Moritz Lenz test exception type for stuff that must be known at compile time
moritz authored
162 throws_like 'm:i(@*ARGS[0])/foo/', X::Value::Dynamic;
163 throws_like 'my enum Foo (:x(@*ARGS[0]))', X::Value::Dynamic;
164
5c0802d Moritz Lenz more exception tests
moritz authored
165 throws_like 'self', X::Syntax::Self::WithoutObject;
478ed38 Moritz Lenz more tests for availabilty-of-self related errors
moritz authored
166 throws_like 'class { has $.x = $.y }', X::Syntax::VirtualCall, call => '$.y';
167 throws_like '$.a', X::Syntax::NoSelf, variable => '$.a';
5c0802d Moritz Lenz more exception tests
moritz authored
168
6467df2 Moritz Lenz test X::Attribute::Package and X::Attribute::NoPackage
moritz authored
169 throws_like 'has $.x', X::Attribute::NoPackage;
170 throws_like 'my module A { has $.x }', X::Attribute::Package, package-type => 'module';
171
46f9b17 Moritz Lenz track exception name change, and add another test
moritz authored
172 throws_like 'has sub a() { }', X::Declaration::Scope, scope => 'has', declaration => 'sub';
173 throws_like 'has package a { }', X::Declaration::Scope, scope => 'has', declaration => 'package';
eb6edd6 Moritz Lenz test X::Declaration::Scope::Multi
moritz authored
174 throws_like 'our multi a() { }', X::Declaration::Scope::Multi, scope => 'our';
a2b6fc2 Moritz Lenz more typed exceptions
moritz authored
175 throws_like 'multi sub () { }', X::Anon::Multi, multiness => 'multi';
176 throws_like 'proto sub () { }', X::Anon::Multi, multiness => 'proto';
3b9a604 Moritz Lenz more typed exceptions
moritz authored
177 throws_like 'class { multi method () { }}', X::Anon::Multi, routine-type => 'method';
5065e35 Moritz Lenz test X::Anon::Augment
moritz authored
178 throws_like 'use MONKEY_TYPING; augment class { }', X::Anon::Augment, package-type => 'class';
3804629 Moritz Lenz test X::Augment::NoSuchType
moritz authored
179 throws_like 'use MONKEY_TYPING; augment class NoSuchClass { }', X::Augment::NoSuchType,
180 package-type => 'class',
181 package => 'NoSuchClass';
c9e3611 Moritz Lenz more robust name clash tests
moritz authored
182 throws_like 'use MONKEY_TYPING; augment class No::Such::Class { }', X::Augment::NoSuchType,
183 package => 'No::Such::Class';
3b9a604 Moritz Lenz more typed exceptions
moritz authored
184
185 throws_like ':45<abcd>', X::Syntax::Number::RadixOutOfRange, radix => 45;
3dab5c0 Moritz Lenz RT #112056
moritz authored
186 throws_like ':0<0>', X::Syntax::Number::RadixOutOfRange, message => rx/0/;
dc3de2d Moritz Lenz X::Syntax::Regex::Adverb
moritz authored
187 throws_like 'rx:g/a/', X::Syntax::Regex::Adverb, adverb => 'g', construct => 'rx';
26f6834 Moritz Lenz X::Syntax::Signature::InvocantMarker
moritz authored
188 throws_like 'my sub f($x, $y:) { }', X::Syntax::Signature::InvocantMarker;
a2b6fc2 Moritz Lenz more typed exceptions
moritz authored
189
1bf4f1d Moritz Lenz X::OutOfRange
moritz authored
190 throws_like 'Date.new("2012-02-30")', X::OutOfRange,
191 range => Range, message => rx/<<1\.\.29>>/;
58512ac Moritz Lenz test index out of range exception
moritz authored
192 throws_like 'use fatal; "foo"[2]', X::OutOfRange, what => rx:i/index/, range => 0..0, got => 2;
1bf4f1d Moritz Lenz X::OutOfRange
moritz authored
193
52f6db6 Moritz Lenz test for X::Routine::Unwrap
moritz authored
194 throws_like 'sub f() { }; &f.unwrap("foo")', X::Routine::Unwrap;
44d0aa3 Moritz Lenz test X::Constructor::Positional
moritz authored
195 throws_like 'Mu.new(1)', X::Constructor::Positional;
39b3eb7 Siddhant Saraf add test for X::Hash::Store::Oddnumber
Siddhant authored
196 throws_like 'my %h = 1', X::Hash::Store::OddNumber;
52f6db6 Moritz Lenz test for X::Routine::Unwrap
moritz authored
197
fcd1668 Moritz Lenz Test for proper error of "sub foo;", RT #68710 and RT #111492
moritz authored
198 # TOOD: might be X::Syntax::Malformed too...
199 throws_like 'sub foo;', X::Syntax::Missing, what => 'block';
157d7b7 Moritz Lenz more tests for "constant" parse errors
moritz authored
200 throws_like 'constant foo;', X::Syntax::Missing, what => /initializer/;
201 throws_like 'constant * = 3;', X::Syntax::Missing, what => /constant/;
fcd1668 Moritz Lenz Test for proper error of "sub foo;", RT #68710 and RT #111492
moritz authored
202
ddc21bf Moritz Lenz test X::Package::Stubbed
moritz authored
203 throws_like 'class A {...}; grammar B { ... }', X::Package::Stubbed, packages => <A B>;
204
9831233 Moritz Lenz track phaser error changes in rakudo
moritz authored
205 throws_like 'my sub a { PRE 0 }; a()', X::Phaser::PrePost, phaser => 'PRE', condition => /0/;
206 throws_like 'my sub a { POST 0 }; a()', X::Phaser::PrePost, phaser => 'POST', condition => /0/;
efa9610 Moritz Lenz typed exceptions for PRE/POST failures
moritz authored
207
d720afa Moritz Lenz test that Str numification error message survives through infix:<+>
moritz authored
208 throws_like 'use fatal; my $x = "5 foo" + 8;', X::Str::Numeric, source => '5 foo', pos => 1,
209 reason => /trailing/;
210
d701cfa Moritz Lenz text X::Method::NotFound on normal and .+ dispatches
moritz authored
211 throws_like '1.foo', X::Method::NotFound, method => 'foo', typename => 'Int';
212 throws_like '1.+foo', X::Method::NotFound, method => 'foo', typename => 'Int';
16238cd Moritz Lenz test private method not found error
moritz authored
213 throws_like 'my class Priv { method x { self!foo } }; Priv.x',
214 X::Method::NotFound,
215 method => '!foo',
216 typename => 'Priv',
217 private => { $_ === True };
eff5942 Moritz Lenz more typed exception tests (X::ControlFlow, X::Method::InvalidQualifier)
moritz authored
218 throws_like '1.List::join', X::Method::InvalidQualifier,
219 method => 'join',
220 invocant => 1,
221 qualifier-type => List;
d701cfa Moritz Lenz text X::Method::NotFound on normal and .+ dispatches
moritz authored
222
903dffc Moritz Lenz test that stubby exception generators can take an argument
moritz authored
223 # RT #58558
224 throws_like '!!! 42', X::AdHoc, payload => 42;
225 throws_like 'use fatal; ... 42', X::AdHoc, payload => 42;
226 {
227 my $c = 0;
228 try {
229 ??? 42;
230 CONTROL { default { $c++ } }
231 }
232 is $c, 1, '??? with argument warns';
233 }
234
ca3a210 Moritz Lenz $!.backtrace generates a Backtrace
moritz authored
235 throws_like 'die "foo"', X::AdHoc, backtrace => Backtrace;
2365690 Moritz Lenz RT #98678, error message for failed sequence deduction
moritz authored
236 throws_like 'use fatal; ~(1, 2, 6 ... 10)', X::Sequence::Deduction;
903dffc Moritz Lenz test that stubby exception generators can take an argument
moritz authored
237
cb7e988 Moritz Lenz test X::TypeCheck::Binding and X::TypeCheck::Return
moritz authored
238 throws_like 'my Str $x := 3', X::TypeCheck::Binding, got => Int, expected => Str;
239 throws_like 'sub f() returns Str { 5 }; f', X::TypeCheck::Return, got => Int, expected => Str;
240
b585e67 Moritz Lenz test for method not found exception
moritz authored
241 throws_like '1.foo', X::Method::NotFound, method => 'foo', typename => 'Int';
5a8433b Moritz Lenz test X::Mixin::NonComposable
moritz authored
242 throws_like 'my class NC { }; NC.new does NC', X::Mixin::NonComposable,
243 :target(*.defined), :rolish(*.^name eq 'NC');
244 throws_like 'my class NC { }; NC.new but NC', X::Mixin::NonComposable,
245 :target(*.defined), :rolish(*.^name eq 'NC');
246
eff5942 Moritz Lenz more typed exception tests (X::ControlFlow, X::Method::InvalidQualifier)
moritz authored
247 throws_like 'last', X::ControlFlow,
248 illegal => 'last', enclosing => 'loop construct';
249 throws_like 'next', X::ControlFlow,
250 illegal => 'next', enclosing => 'loop construct';
251 throws_like 'redo', X::ControlFlow,
252 illegal => 'redo', enclosing => 'loop construct';
b585e67 Moritz Lenz test for method not found exception
moritz authored
253
c147454 Moritz Lenz test X::Inheritance::Unsupported
moritz authored
254 throws_like 'my package A { }; my class B is A { }', X::Inheritance::Unsupported;
d701cfa Moritz Lenz text X::Method::NotFound on normal and .+ dispatches
moritz authored
255
5eefbf8 Moritz Lenz test X::Export::NameClash
moritz authored
256 throws_like 'my module Expo { sub f is export { }; { sub f is export { } } }',
257 X::Export::NameClash, symbol => '&f';
258
78d560a Moritz Lenz test for X::HyperOp::NonDWIM
moritz authored
259 #?rakudo skip 'segfaults'
260 throws_like '<a b> »+« <c>', X::HyperOp::NonDWIM,
261 left-elems => 2, right-elems => 1,
262 operator => { .name eq 'infix:<+>' };
263
264 throws_like '<a b> »+« <c>', X::HyperOp::NonDWIM,
265 left-elems => 2, right-elems => 1;
266
e708a8c Moritz Lenz test X::ControlFlow::Return
moritz authored
267 throws_like 'my sub f() { gather { return } }; ~f()', X::ControlFlow::Return;
268
a1248db Moritz Lenz test X::Temporal::InvalidFormat
moritz authored
269 throws_like 'DateTime.new("2012/04")', X::Temporal::InvalidFormat,
270 invalid-str => '2012/04',
271 target => 'DateTime';
272
273 throws_like 'Date.new("2012/04")', X::Temporal::InvalidFormat,
274 invalid-str => '2012/04',
275 target => 'Date';
276
3d3f9a2 Moritz Lenz initial tests for typed exceptions; very unstructured for now
moritz authored
277 done;
Something went wrong with that request. Please try again.