Skip to content
Browse files

Fix some package/eval related issues.

eval now has a better idea of current package and this can caused
some issues for various tests that assumed that an eval would always
start out with the current package being GLOBAL.
  • Loading branch information...
1 parent 7673df5 commit 2267094de31af54c6b9ba06bc5c4d11b116bad73 @jnthn jnthn committed Oct 11, 2012
Showing with 10 additions and 12 deletions.
  1. +5 −7 S12-class/basic.t
  2. +5 −5 S32-exceptions/misc.t
View
12 S12-class/basic.t
@@ -99,17 +99,15 @@ class One::Two::Three { } # auto-vivifies package One::Two
class One::Two { }
ok(One::Two.new, 'created One::Two after One::Two::Three');
#?pugs todo
-eval_dies_ok 'class One::Two { }', 'cannot redeclare an existing class';
+dies_ok { eval 'class One::Two { }' }, 'cannot redeclare an existing class';
eval_lives_ok q[BEGIN {class Level1::Level2::Level3 {};}; class Level1::Level2 {};], 'RT 62898';
#?pugs todo
{
- eval_dies_ok q[
- class A61354_1 {
- eval('method x { "OH HAI" }')
- };
- A61354_1.x;
- ], "can't just use eval to add method to class";
+ class A61354_1 {
+ eval('method x { "OH HAI" }')
+ };
+ is A61354_1.x, "OH HAI", "can just use eval to add method to class";
}
# RT #67784
View
10 S32-exceptions/misc.t
@@ -106,10 +106,10 @@ throws_like 'my @a = 1, => 2', X::Syntax::InfixInTermPosition, infix => '=>';
throws_like 'sub f(:in(:$in)) { }', X::Signature::NameClash, name => 'in';
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 'my role R { }; 99 but R("wrong");', X::Role::Initialization;
+throws_like 'my role R { has $.x; has $.y }; 99 but R("wrong");', X::Role::Initialization;
+throws_like 'my role R { }; 99 does R("wrong");', X::Role::Initialization;
+throws_like 'my role R { has $.x; has $.y }; 99 does R("wrong");', X::Role::Initialization;
throws_like 'sub f($a?, $b) { }', X::Parameter::WrongOrder,
misplaced => 'required',
@@ -216,7 +216,7 @@ throws_like 'use fatal; ... 42', X::AdHoc, payload => 42;
throws_like 'die "foo"', X::AdHoc, backtrace => Backtrace;
throws_like 'use fatal; ~(1, 2, 6 ... 10)', X::Sequence::Deduction;
-throws_like 'class B does Int { }', X::Composition::NotComposable, target-name => 'B', composer => Int;
+throws_like 'my class B does Int { }', X::Composition::NotComposable, target-name => 'B', composer => Int;
throws_like 'my Str $x := 3', X::TypeCheck::Binding, got => Int, expected => Str;
throws_like 'sub f() returns Str { 5 }; f', X::TypeCheck::Return, got => Int, expected => Str;
throws_like 'my Int $x = "foo"', X::TypeCheck::Assignment, got => 'foo',

0 comments on commit 2267094

Please sign in to comment.
Something went wrong with that request. Please try again.