This is an automatically generated mail to inform you that tests are now available in t/spec/S05-grammar/methods.t
commit 1304265c541f9a396febab7315706dff5cef6af6 Author: moritz <mor...@c213334d-75ef-0310-aa23-eaa082d1ae64> Date: Tue Oct 20 20:45:18 2009 +0000 [t/spec] tests for RT #69228, calling methods from a grammar git-svn-id: http://svn.pugscode.org/p...@28860 c213334d-75ef-0310-aa23-eaa082d1ae64 diff --git a/t/spec/S05-grammar/methods.t b/t/spec/S05-grammar/methods.t new file mode 100644 index 0000000..6da2f7d --- /dev/null +++ b/t/spec/S05-grammar/methods.t @@ -0,0 +1,17 @@ +use v6; +use Test; + +plan *; + +grammar WithMethod { + rule TOP { 'lorem' | <.panic> } + method panic { die "The sky is falling!"; } +}; + +dies_ok { WithMethod.parse('unrelated') }, + 'Can call die() from a method within a grammar'; + +try { WithMethod.parse('unrelated') }; +ok "$!" ~~ /'The sky is falling!'/, 'and got the exception message'; + +done_testing;