From 296a529c710c580d064ae0282b64545a7a21a3a2 Mon Sep 17 00:00:00 2001 From: Timo Paulssen Date: Thu, 29 Mar 2012 02:53:43 +0200 Subject: [PATCH 1/3] test for X::Does::TypeObject raising for 'does' operator. --- S32-exceptions/misc.t | 2 ++ 1 file changed, 2 insertions(+) diff --git a/S32-exceptions/misc.t b/S32-exceptions/misc.t index ecd10f9cc3..d0bc874d24 100644 --- a/S32-exceptions/misc.t +++ b/S32-exceptions/misc.t @@ -115,6 +115,8 @@ throws_like 'my $::("foo")', X::Syntax::Variable::IndirectDeclaration; throws_like '@a', X::Undeclared, symbol => '@a'; throws_like 'augment class Any { }', X::Syntax::Augment::WithoutMonkeyTyping; throws_like 'use MONKEY_TYPING; augment role Positional { }', X::Syntax::Augment::Role; +throws_like 'my $foo does &Int', X::Does::TypeObject; +throws_like 'my $foo does &Int, &Bool', X::Does::TypeObject; throws_like 'sub f($a?, $b) { }', X::Parameter::WrongOrder, misplaced => 'required', From 709242e4da7c0277c48523b5c7cf7f389cfeee7e Mon Sep 17 00:00:00 2001 From: Timo Paulssen Date: Thu, 29 Mar 2012 04:12:05 +0200 Subject: [PATCH 2/3] tests for X::Bind::ZenSlice. --- S32-exceptions/misc.t | 3 +++ 1 file changed, 3 insertions(+) diff --git a/S32-exceptions/misc.t b/S32-exceptions/misc.t index d0bc874d24..d7a5fac395 100644 --- a/S32-exceptions/misc.t +++ b/S32-exceptions/misc.t @@ -93,6 +93,9 @@ throws_like '1!foo()', throws_like 'sub f() { }; f() := 2', X::Bind::WrongLHS; throws_like 'my int $x := 2', X::Bind::NativeType; +throws_like 'my @a; @a[] := ', X::Bind::ZenSlice, what => 'array'; +throws_like 'my %a; %a{} := foo=>1, bar=>2, baz=>3', X::Bind::ZenSlice, what => 'hash'; + throws_like 'for (1; 1; 1) { }', X::Obsolete, old => rx/<>/, From 104f5224d4ecba8bcae316f07c634079635a69c8 Mon Sep 17 00:00:00 2001 From: Timo Paulssen Date: Thu, 29 Mar 2012 04:39:22 +0200 Subject: [PATCH 3/3] add tests for X::Role::Initialization. --- S32-exceptions/misc.t | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/S32-exceptions/misc.t b/S32-exceptions/misc.t index d7a5fac395..945a76023b 100644 --- a/S32-exceptions/misc.t +++ b/S32-exceptions/misc.t @@ -120,6 +120,10 @@ throws_like 'augment class Any { }', X::Syntax::Augment::WithoutMonkeyTyping; throws_like 'use MONKEY_TYPING; augment role Positional { }', X::Syntax::Augment::Role; throws_like 'my $foo does &Int', X::Does::TypeObject; throws_like 'my $foo does &Int, &Bool', X::Does::TypeObject; +throws_like 'role R { }; 99 but R("wrong");', X::Role::Initialization; +throws_like 'role R { has $.x; has $.y }; 99 but R("wrong");', X::Role::Initialization; +throws_like 'role R { }; 99 does R("wrong");', X::Role::Initialization; +throws_like 'role R { has $.x; has $.y }; 99 does R("wrong");', X::Role::Initialization; throws_like 'sub f($a?, $b) { }', X::Parameter::WrongOrder, misplaced => 'required',