From ef0da9316b4d011b8ce618cfc11579c53f3aad7b Mon Sep 17 00:00:00 2001 From: dukeleto Date: Mon, 7 Sep 2009 05:27:31 +0000 Subject: [PATCH] [t] Refactor some namespace pmc tests to use throws_like git-svn-id: https://svn.parrot.org/parrot/trunk@41096 d31e2699-5ff4-0310-a27c-f18f2fbe73fe --- t/pmc/namespace.t | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/t/pmc/namespace.t b/t/pmc/namespace.t index 214dabf52d..c8a15d4f9b 100644 --- a/t/pmc/namespace.t +++ b/t/pmc/namespace.t @@ -192,25 +192,21 @@ of the NameSpace PMC: ok(0, "Cannot get Sub from NameSpace Foo::Bar") test4: - push_eh eh4 + throws_like( <<'CODE', 'Null\ PMC\ access\ in\ invoke', 'Invoking a non-existent sub') +.sub main $P0 = get_global ["Foo"], "SUB_THAT_DOES_NOT_EXIST" $P0() - ok(0, "Found and invoked a non-existant sub") - goto test5 - eh4: - # Should we check the exact error message here? - ok(1, "Cannot invoke a Sub that doesn't exist") +.end +CODE test5: # this used to behave differently from the previous case. - push_eh eh5 + throws_like( <<'CODE', 'Null\ PMC\ access\ in\ invoke', 'Invoking a non-existent sub') +.sub main $P0 = get_global ["Foo";"Bar"], "SUB_THAT_DOES_NOT_EXIST" $P0() - ok(0, "Found and invoked a non-existant sub") - goto test6 - eh5: - # Should we check the exact error message here? - ok(1, "Cannot invoke a Sub that doesn't exist") +.end +CODE test6: push_eh eh6 -- 2.11.4.GIT