Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 274 lines (228 sloc) 12.762 kb
3d3f9a24 » moritz
2011-12-17 initial tests for typed exceptions; very unstructured for now
1 use v6;
2 use Test;
8380ccfc » moritz
2012-06-05 move throws_like to Test::Util
3 BEGIN { @*INC.push('t/spec/packages/') };
4 use Test::Util;
3d3f9a24 » moritz
2011-12-17 initial tests for typed exceptions; very unstructured for now
5
2002a2fe » moritz
2012-01-30 more typed exceptions
6 #?DOES 1
88dbaa76 » moritz
2012-05-27 X::Buf::Pack
7 throws_like { Buf.new().Str }, X::Buf::AsStr, method => 'Str';;
8 throws_like 'pack("B", 1)', X::Buf::Pack, directive => 'B';
9 throws_like 'Buf.new.unpack("B")', X::Buf::Pack, directive => 'B';
7a26e136 » moritz
2012-06-03 test X::Buf::Pack::NonASCII
10 throws_like 'pack "A1", "mÄ"', X::Buf::Pack::NonASCII, char => 'Ä';
67636640 » moritz
2012-02-11 fix test for X::Attribute::Undeclared
11 throws_like 'my class Foo { method a() { $!bar } }', X::Attribute::Undeclared,
3d3f9a24 » moritz
2011-12-17 initial tests for typed exceptions; very unstructured for now
12 name => '$!bar', package-name => 'Foo';
13 throws_like 'sub f() { $^x }', X::Signature::Placeholder,
14 line => 1;
15
4c68d1a5 » moritz
2011-12-18 skipped tests for X::Obsolete
16 #?rakudo skip 'parsing of $& and other p5 variables'
9fb1b22e » moritz
2012-03-27 test for qr obsoletion message
17 throws_like '$&', X::Obsolete, old => '$@ variable', replacement => '$, rx/<<rx>>// or $()';
18 throws_like 'qr/a/', X::Obsolete, old => rx/<<qr>>/, replacement => rx/<<rx>>/;
4c68d1a5 » moritz
2011-12-18 skipped tests for X::Obsolete
19
f52c2ed5 » moritz
2012-01-23 test presence of placeholder attribute of X::Placeholder::Block excep…
20 throws_like 'do { $^x }', X::Placeholder::Block, placeholder => '$^x';
21 throws_like 'do { @_ }', X::Placeholder::Block, placeholder => '@_';
22 throws_like 'class { $^x }', X::Placeholder::Block, placeholder => '$^x';
8d41f565 » moritz
2012-01-24 more typed exception tests, better diagnosis
23 throws_like '$^x', X::Placeholder::Mainline, placeholder => '$^x';
d5ac5a66 » moritz
2012-02-03 RT #73502, @_ in the mainline
24 # RT #73502
25 throws_like '@_', X::Placeholder::Mainline, placeholder => '@_';
bea87e2b » moritz
2012-03-04 RT #85942
26 # RT #85942
27 throws_like '"foo".{ say $^a }', X::Placeholder::Mainline;
28
29
8d41f565 » moritz
2012-01-24 more typed exception tests, better diagnosis
30 throws_like 'sub f(*@a = 2) { }', X::Parameter::Default, how => 'slurpy';
31 throws_like 'sub f($x! = 3) { }', X::Parameter::Default, how => 'required';
32 throws_like 'sub f(:$x! = 3) { }', X::Parameter::Default, how => 'required';
33 throws_like 'sub f($:x) { }', X::Parameter::Placeholder,
34 parameter => '$:x',
35 right => ':$x';
36 throws_like 'sub f($?x) { }', X::Parameter::Twigil,
37 parameter => '$?x',
38 twigil => '?';
a97dc2a5 » moritz
2012-01-26 track change of error class names; add some more redeclaration tests
39 throws_like 'sub (Int Str $x) { }', X::Parameter::MultipleTypeConstraints;
8d41f565 » moritz
2012-01-24 more typed exception tests, better diagnosis
40
41
42
a97dc2a5 » moritz
2012-01-26 track change of error class names; add some more redeclaration tests
43 # some of these redeclaration errors take different code
44 # paths in rakudo, so we over-test a bit to catch them all,
45 # even if the tests look rather boring;
0b7d7d24 » moritz
2012-01-23 more typed exception tests
46 throws_like 'my @a; my @a', X::Redeclaration, symbol => '@a';
47 throws_like 'sub a { }; sub a { }',X::Redeclaration, symbol => 'a', what => 'routine';
dddf1116 » moritz
2012-05-29 RT #78370, my &a; sub a { } redeclaration error
48 # RT #78370
cf0e3428 » moritz
2012-05-29 oops, meant to test something else
49 #?rakudo skip 'RT 78370'
50 throws_like 'my &a; multi a { }', X::Redeclaration, symbol => 'a', what => 'routine';
63626c2d » moritz
2012-02-08 another redeclaration test
51 throws_like 'sub a { }; multi sub a { }',X::Redeclaration, symbol => 'a', what => 'routine';
a97dc2a5 » moritz
2012-01-26 track change of error class names; add some more redeclaration tests
52 throws_like 'my class A { }; my class A { }', X::Redeclaration, symbol => 'A';
c9e36113 » moritz
2012-04-14 more robust name clash tests
53 throws_like 'my class B { }; my subset B of Any;', X::Redeclaration, symbol => 'B';
a97dc2a5 » moritz
2012-01-26 track change of error class names; add some more redeclaration tests
54 throws_like 'CATCH { }; CATCH { }', X::Phaser::Multiple, block => 'CATCH';
75c081fd » moritz
2012-07-31 tests for multiple return type exceptions
55 # multiple return types
56 throws_like 'sub f(--> List) returns Str { }', X::Redeclaration;
57 throws_like 'my Int sub f(--> Str) { }', X::Redeclaration;
fbb78ed5 » moritz
2012-01-23 test for X::Placeholder::Block
58
6467df25 » moritz
2012-02-23 test X::Attribute::Package and X::Attribute::NoPackage
59 throws_like 'my class A { my @a; @a!List::foo() }',
c01e5d67 » moritz
2012-01-24 tests for typed private method call exceptions
60 X::Method::Private::Permission,
61 method => 'foo',
62 calling-package => 'A',
63 source-package => 'List';
64
65 throws_like '1!foo()',
a97dc2a5 » moritz
2012-01-26 track change of error class names; add some more redeclaration tests
66 X::Method::Private::Unqualified,
c01e5d67 » moritz
2012-01-24 tests for typed private method call exceptions
67 method => 'foo';
68
d9262efc » moritz
2012-06-03 [throws_ok] allow subtypes; Liskov applies
69 throws_like 'sub f() { }; f() := 2', X::Bind;
70 throws_like 'OUTER := 5', X::Bind, target => /OUTER/;
a8246984 » moritz
2012-01-25 typed binding excpetions
71 throws_like 'my int $x := 2', X::Bind::NativeType;
c6df8c59 » moritz
2012-05-27 update and expand tests for binding to unbindable stuff
72 throws_like 'my @a; @a[] := <foo bar baz>', X::Bind::ZenSlice, type => Array;
73 throws_like 'my %a; %a{} := foo=>1, bar=>2, baz=>3', X::Bind::ZenSlice, type => Hash;
74 throws_like 'my @a; @a[0, 1] := (2, 3)', X::Bind::Slice, type => Array;
75 throws_like 'my %a; %a<a b> := (2, 3)', X::Bind::Slice, type => Hash;
709242e4 » timo
2012-03-29 tests for X::Bind::ZenSlice.
76
a8246984 » moritz
2012-01-25 typed binding excpetions
77
dc765ebb » moritz
2012-01-25 tests for typed exceptions
78 throws_like 'for (1; 1; 1) { }', X::Obsolete,
79 old => rx/<<for>>/,
80 replacement => rx/<<loop>>/;
81 throws_like 'foreach (1..10) { }', X::Obsolete,
82 old => "'foreach'",
83 replacement => "'for'";
84 throws_like 'undef', X::Obsolete,
85 old => rx/<<undef>>/;
86
a97dc2a5 » moritz
2012-01-26 track change of error class names; add some more redeclaration tests
87 throws_like 'my $a::::b', X::Syntax::Name::Null;
d1f0fd85 » moritz
2012-01-28 tests for typed syntax errors
88 throws_like 'unless 1 { } else { }', X::Syntax::UnlessElse;
89 throws_like 'for my $x (1, 2, 3) { }', X::Syntax::P5;
425b7869 » moritz
2012-08-02 test for extra information in X::Syntax::NegatedPair
90 throws_like ':!foo(3)', X::Syntax::NegatedPair, key => 'foo';
d1f0fd85 » moritz
2012-01-28 tests for typed syntax errors
91 throws_like 'my $0', X::Syntax::Variable::Numeric;
b2914792 » moritz
2012-02-24 test parameter variant of X::Syntax::Variable::Numeric
92 throws_like 'my sub f($0) { }', X::Syntax::Variable::Numeric, what => 'parameter';
d1f0fd85 » moritz
2012-01-28 tests for typed syntax errors
93 throws_like 'my $<a>', X::Syntax::Variable::Match;
33e961e4 » moritz
2012-01-30 RT #69230, my $!foo
94 throws_like 'my class A { my $!foo }', X::Syntax::Variable::Twigil, twigil => '!', scope => 'my';
d9f7caae » moritz
2012-05-03 RT #112724, line numbers from warnings
95 throws_like 'my $?FILE', X::Syntax::Variable::Twigil, twigil => '?', scope => 'my';
277e13dd » moritz
2012-01-28 more tests for typed syntax errors
96 throws_like 'my $::("foo")', X::Syntax::Variable::IndirectDeclaration;
171ad0a8 » moritz
2012-02-07 test X::Undeclared
97 throws_like '@a', X::Undeclared, symbol => '@a';
277e13dd » moritz
2012-01-28 more tests for typed syntax errors
98 throws_like 'augment class Any { }', X::Syntax::Augment::WithoutMonkeyTyping;
99 throws_like 'use MONKEY_TYPING; augment role Positional { }', X::Syntax::Augment::Role;
fd201d9a » moritz
2012-04-05 RT #82984
100 throws_like 'sub postbla:sym<foo>() { }', X::Syntax::Extension::Category, category => 'postbla';
ab9c613e » moritz
2012-05-29 RT #83992, proper error message for infix in term position
101 # RT #83992
102 throws_like 'my @a = 1, => 2', X::Syntax::InfixInTermPosition, infix => '=>';
840bfdaa » moritz
2012-05-13 test for X::Signature::NameClash
103 throws_like 'sub f(:in(:$in)) { }', X::Signature::NameClash, name => 'in';
296a529c » timo
2012-03-29 test for X::Does::TypeObject raising for 'does' operator.
104 throws_like 'my $foo does &Int', X::Does::TypeObject;
105 throws_like 'my $foo does &Int, &Bool', X::Does::TypeObject;
104f5224 » timo
2012-03-29 add tests for X::Role::Initialization.
106 throws_like 'role R { }; 99 but R("wrong");', X::Role::Initialization;
107 throws_like 'role R { has $.x; has $.y }; 99 but R("wrong");', X::Role::Initialization;
108 throws_like 'role R { }; 99 does R("wrong");', X::Role::Initialization;
109 throws_like 'role R { has $.x; has $.y }; 99 does R("wrong");', X::Role::Initialization;
277e13dd » moritz
2012-01-28 more tests for typed syntax errors
110
111 throws_like 'sub f($a?, $b) { }', X::Parameter::WrongOrder,
112 misplaced => 'required',
113 after => 'optional';
114 throws_like 'sub f(*@a, $b) { }', X::Parameter::WrongOrder,
115 misplaced => 'required',
116 after => 'variadic';
117 throws_like 'sub f(*@a, $b?) { }', X::Parameter::WrongOrder,
118 misplaced => 'optional positional',
119 after => 'variadic';
03faea74 » moritz
2012-01-26 X::Syntax::Name::NotNull
120
2002a2fe » moritz
2012-01-30 more typed exceptions
121 #?rakudo skip 'parsing regression'
122 throws_like '#`', X::Syntax::Comment::Embedded;
1af5f7a9 » moritz
2012-03-02 RT #71814, =begin without identifier
123 # RT #71814
124 throws_like "=begin\n", X::Syntax::Pod::BeginWithoutIdentifier, line => 1, filename => rx/eval/;
2002a2fe » moritz
2012-01-30 more typed exceptions
125
126 throws_like '@', X::Syntax::SigilWithoutName;
127 throws_like '1∞', X::Syntax::Confused;
e4dee679 » moritz
2012-02-23 X::Syntax::Missing
128 throws_like 'for 1, 2', X::Syntax::Missing, what => 'block';
a78af8ce » moritz
2012-02-24 X::Syntax::Reserved
129 throws_like 'my @a()', X::Syntax::Reserved, reserved => /shape/ & /array/;
130 throws_like 'my &a()', X::Syntax::Reserved, instead => /':()'/;
2002a2fe » moritz
2012-01-30 more typed exceptions
131
59f3f35d » moritz
2012-02-08 test exception type for stuff that must be known at compile time
132 throws_like 'm:i(@*ARGS[0])/foo/', X::Value::Dynamic;
133
5c0802db » moritz
2012-02-11 more exception tests
134 throws_like 'self', X::Syntax::Self::WithoutObject;
478ed38d » moritz
2012-02-11 more tests for availabilty-of-self related errors
135 throws_like 'class { has $.x = $.y }', X::Syntax::VirtualCall, call => '$.y';
136 throws_like '$.a', X::Syntax::NoSelf, variable => '$.a';
b3c20067 » moritz
2012-08-07 RT #59118
137 # RT #59118
138 throws_like 'my class B0Rk { $.a }', X::Syntax::NoSelf, variable => '$.a';
5c0802db » moritz
2012-02-11 more exception tests
139
6467df25 » moritz
2012-02-23 test X::Attribute::Package and X::Attribute::NoPackage
140 throws_like 'has $.x', X::Attribute::NoPackage;
141 throws_like 'my module A { has $.x }', X::Attribute::Package, package-type => 'module';
142
46f9b17d » moritz
2012-03-08 track exception name change, and add another test
143 throws_like 'has sub a() { }', X::Declaration::Scope, scope => 'has', declaration => 'sub';
144 throws_like 'has package a { }', X::Declaration::Scope, scope => 'has', declaration => 'package';
eb6edd64 » moritz
2012-03-15 test X::Declaration::Scope::Multi
145 throws_like 'our multi a() { }', X::Declaration::Scope::Multi, scope => 'our';
a2b6fc20 » moritz
2012-02-23 more typed exceptions
146 throws_like 'multi sub () { }', X::Anon::Multi, multiness => 'multi';
147 throws_like 'proto sub () { }', X::Anon::Multi, multiness => 'proto';
3b9a6049 » moritz
2012-02-23 more typed exceptions
148 throws_like 'class { multi method () { }}', X::Anon::Multi, routine-type => 'method';
5065e35d » moritz
2012-02-23 test X::Anon::Augment
149 throws_like 'use MONKEY_TYPING; augment class { }', X::Anon::Augment, package-type => 'class';
3804629e » moritz
2012-02-23 test X::Augment::NoSuchType
150 throws_like 'use MONKEY_TYPING; augment class NoSuchClass { }', X::Augment::NoSuchType,
151 package-type => 'class',
152 package => 'NoSuchClass';
c9e36113 » moritz
2012-04-14 more robust name clash tests
153 throws_like 'use MONKEY_TYPING; augment class No::Such::Class { }', X::Augment::NoSuchType,
154 package => 'No::Such::Class';
3b9a6049 » moritz
2012-02-23 more typed exceptions
155
156 throws_like ':45<abcd>', X::Syntax::Number::RadixOutOfRange, radix => 45;
3dab5c0c » moritz
2012-03-30 RT #112056
157 throws_like ':0<0>', X::Syntax::Number::RadixOutOfRange, message => rx/0/;
dc3de2d6 » moritz
2012-02-24 X::Syntax::Regex::Adverb
158 throws_like 'rx:g/a/', X::Syntax::Regex::Adverb, adverb => 'g', construct => 'rx';
26f68343 » moritz
2012-02-26 X::Syntax::Signature::InvocantMarker
159 throws_like 'my sub f($x, $y:) { }', X::Syntax::Signature::InvocantMarker;
a2b6fc20 » moritz
2012-02-23 more typed exceptions
160
1bf4f1dc » moritz
2012-02-26 X::OutOfRange
161 throws_like 'Date.new("2012-02-30")', X::OutOfRange,
162 range => Range, message => rx/<<1\.\.29>>/;
c04814dc » moritz
2012-06-03 test leap second exception
163 throws_like 'DateTime.new(year => 2012, month => 5, day => 22, hour => 18, minute => 3, second => 60)',
164 X::OutOfRange, comment => /'leap second'/;
58512ac3 » moritz
2012-04-04 test index out of range exception
165 throws_like 'use fatal; "foo"[2]', X::OutOfRange, what => rx:i/index/, range => 0..0, got => 2;
1bf4f1dc » moritz
2012-02-26 X::OutOfRange
166
52f6db64 » moritz
2012-02-27 test for X::Routine::Unwrap
167 throws_like 'sub f() { }; &f.unwrap("foo")', X::Routine::Unwrap;
44d0aa37 » moritz
2012-02-27 test X::Constructor::Positional
168 throws_like 'Mu.new(1)', X::Constructor::Positional;
39b3eb78 » Siddhant
2012-02-28 add test for X::Hash::Store::Oddnumber
169 throws_like 'my %h = 1', X::Hash::Store::OddNumber;
52f6db64 » moritz
2012-02-27 test for X::Routine::Unwrap
170
fcd16681 » moritz
2012-03-02 Test for proper error of "sub foo;", RT #68710 and RT #111492
171 # TOOD: might be X::Syntax::Malformed too...
172 throws_like 'sub foo;', X::Syntax::Missing, what => 'block';
157d7b7c » moritz
2012-03-03 more tests for "constant" parse errors
173 throws_like 'constant foo;', X::Syntax::Missing, what => /initializer/;
174 throws_like 'constant * = 3;', X::Syntax::Missing, what => /constant/;
fcd16681 » moritz
2012-03-02 Test for proper error of "sub foo;", RT #68710 and RT #111492
175
ddc21bfd » moritz
2012-03-08 test X::Package::Stubbed
176 throws_like 'class A {...}; grammar B { ... }', X::Package::Stubbed, packages => <A B>;
177
98312337 » moritz
2012-03-18 track phaser error changes in rakudo
178 throws_like 'my sub a { PRE 0 }; a()', X::Phaser::PrePost, phaser => 'PRE', condition => /0/;
179 throws_like 'my sub a { POST 0 }; a()', X::Phaser::PrePost, phaser => 'POST', condition => /0/;
efa96102 » moritz
2012-03-18 typed exceptions for PRE/POST failures
180
d720afa0 » moritz
2012-03-25 test that Str numification error message survives through infix:<+>
181 throws_like 'use fatal; my $x = "5 foo" + 8;', X::Str::Numeric, source => '5 foo', pos => 1,
182 reason => /trailing/;
7bac3cad » pmichaud
2012-07-08 Update a .match failure test.
183 throws_like '"a".match(:x([1, 2, 3]), /a/).Str', X::Str::Match::x, got => Array;
7d371b61 » moritz
2012-06-03 test X::Str::Trans::IllegalKey, sorear++
184 throws_like '"a".trans([Any.new] => [Any.new])', X::Str::Trans::IllegalKey, key => Any;
7b9ba336 » moritz
2012-06-03 test X::Str::Trans::InvalidArg
185 throws_like '"a".trans(rx/a/)', X::Str::Trans::InvalidArg, got => Regex;
d720afa0 » moritz
2012-03-25 test that Str numification error message survives through infix:<+>
186
d701cfa9 » moritz
2012-05-27 text X::Method::NotFound on normal and .+ dispatches
187 throws_like '1.foo', X::Method::NotFound, method => 'foo', typename => 'Int';
188 throws_like '1.+foo', X::Method::NotFound, method => 'foo', typename => 'Int';
16238cd7 » moritz
2012-05-27 test private method not found error
189 throws_like 'my class Priv { method x { self!foo } }; Priv.x',
190 X::Method::NotFound,
191 method => '!foo',
192 typename => 'Priv',
193 private => { $_ === True };
eff5942a » moritz
2012-05-27 more typed exception tests (X::ControlFlow, X::Method::InvalidQualifier)
194 throws_like '1.List::join', X::Method::InvalidQualifier,
195 method => 'join',
196 invocant => 1,
197 qualifier-type => List;
d701cfa9 » moritz
2012-05-27 text X::Method::NotFound on normal and .+ dispatches
198
903dffc1 » moritz
2012-03-30 test that stubby exception generators can take an argument
199 # RT #58558
200 throws_like '!!! 42', X::AdHoc, payload => 42;
201 throws_like 'use fatal; ... 42', X::AdHoc, payload => 42;
202 {
203 my $c = 0;
204 try {
205 ??? 42;
206 CONTROL { default { $c++ } }
207 }
208 is $c, 1, '??? with argument warns';
209 }
210
ca3a210c » moritz
2012-03-31 $!.backtrace generates a Backtrace
211 throws_like 'die "foo"', X::AdHoc, backtrace => Backtrace;
2365690f » moritz
2012-04-05 RT #98678, error message for failed sequence deduction
212 throws_like 'use fatal; ~(1, 2, 6 ... 10)', X::Sequence::Deduction;
903dffc1 » moritz
2012-03-30 test that stubby exception generators can take an argument
213
b94655cb » moritz
2012-06-03 test X::Composition::NotComposable
214 throws_like 'class B does Int { }', X::Composition::NotComposable, target-name => 'B', composer => Int;
cb7e9883 » moritz
2012-05-15 test X::TypeCheck::Binding and X::TypeCheck::Return
215 throws_like 'my Str $x := 3', X::TypeCheck::Binding, got => Int, expected => Str;
216 throws_like 'sub f() returns Str { 5 }; f', X::TypeCheck::Return, got => Int, expected => Str;
6625f6f8 » moritz
2012-06-06 test X::TypeCheck::Assignment
217 throws_like 'my Int $x = "foo"', X::TypeCheck::Assignment, got => 'foo',
218 expected => Int, symbol => '$x';
cb7e9883 » moritz
2012-05-15 test X::TypeCheck::Binding and X::TypeCheck::Return
219
61b24d9e » moritz
2012-06-06 test X::Assignment::RO, and add tests for RT #113534
220 throws_like 'sub f() { }; f() = 3', X::Assignment::RO;
221 throws_like '1.0 = 3', X::Assignment::RO;
222 # RT #113534
223 #?rakudo 3 skip '113534'
224 throws_like '120 = 3', X::Assignment::RO;
225 throws_like '1e0 = 3', X::Assignment::RO;
226 throws_like '"a" = 3', X::Assignment::RO;
227
b585e672 » moritz
2012-05-17 test for method not found exception
228 throws_like '1.foo', X::Method::NotFound, method => 'foo', typename => 'Int';
5a8433b1 » moritz
2012-05-27 test X::Mixin::NonComposable
229 throws_like 'my class NC { }; NC.new does NC', X::Mixin::NonComposable,
230 :target(*.defined), :rolish(*.^name eq 'NC');
231 throws_like 'my class NC { }; NC.new but NC', X::Mixin::NonComposable,
232 :target(*.defined), :rolish(*.^name eq 'NC');
233
eff5942a » moritz
2012-05-27 more typed exception tests (X::ControlFlow, X::Method::InvalidQualifier)
234 throws_like 'last', X::ControlFlow,
235 illegal => 'last', enclosing => 'loop construct';
236 throws_like 'next', X::ControlFlow,
237 illegal => 'next', enclosing => 'loop construct';
238 throws_like 'redo', X::ControlFlow,
239 illegal => 'redo', enclosing => 'loop construct';
b585e672 » moritz
2012-05-17 test for method not found exception
240
c1474546 » moritz
2012-05-28 test X::Inheritance::Unsupported
241 throws_like 'my package A { }; my class B is A { }', X::Inheritance::Unsupported;
d701cfa9 » moritz
2012-05-27 text X::Method::NotFound on normal and .+ dispatches
242
5eefbf8f » moritz
2012-05-28 test X::Export::NameClash
243 throws_like 'my module Expo { sub f is export { }; { sub f is export { } } }',
244 X::Export::NameClash, symbol => '&f';
245
385370f4 » moritz
2012-06-12 label and unfudge test for RT #113408, and remove nearly identical se…
246 # RT #113408
78d560a7 » moritz
2012-05-28 test for X::HyperOp::NonDWIM
247 throws_like '<a b> »+« <c>', X::HyperOp::NonDWIM,
248 left-elems => 2, right-elems => 1,
249 operator => { .name eq 'infix:<+>' };
250
e708a8cb » moritz
2012-05-29 test X::ControlFlow::Return
251 throws_like 'my sub f() { gather { return } }; ~f()', X::ControlFlow::Return;
252
a1248dbe » moritz
2012-06-03 test X::Temporal::InvalidFormat
253 throws_like 'DateTime.new("2012/04")', X::Temporal::InvalidFormat,
254 invalid-str => '2012/04',
255 target => 'DateTime';
256
257 throws_like 'Date.new("2012/04")', X::Temporal::InvalidFormat,
258 invalid-str => '2012/04',
259 target => 'Date';
260
6aa9f568 » moritz
2012-06-03 test X::Eval::NoSuchLang
261 throws_like 'eval("foo", :lang<no-such-language>)',
262 X::Eval::NoSuchLang,
263 lang => 'no-such-language';
264
3ed2a344 » moritz
2012-06-03 test X::Temporal::Truncation
265 throws_like 'DateTime.now.truncated-to(:foo)', X::Temporal::Truncation;
266 throws_like 'Date.today.truncated-to(:foo)', X::Temporal::Truncation;
7a77b2a8 » moritz
2012-06-04 test X::DateTime::TimezoneClash
267 throws_like 'DateTime.new("1998-12-31T23:59:60+0200", :timezone<Z>)', X::DateTime::TimezoneClash;
7d371b61 » moritz
2012-06-03 test X::Str::Trans::IllegalKey, sorear++
268
85f737a4 » moritz
2012-06-04 test X::Set::Coerce
269 throws_like 'Set(Any.new)', X::Set::Coerce;
270
a47ed9fb » moritz
2012-07-12 test X::Numeric::Real
271 throws_like 'use fatal; (1+2i).Num', X::Numeric::Real, target => Num;
272 throws_like 'use fatal; (1+2i).Real', X::Numeric::Real, target => Real;
273
3d3f9a24 » moritz
2011-12-17 initial tests for typed exceptions; very unstructured for now
274 done;
Something went wrong with that request. Please try again.