From dd714f82e244f1b721ee0968691319a0d47c9eda Mon Sep 17 00:00:00 2001 From: Jonathan Worthington Date: Wed, 19 Oct 2016 16:51:06 +0200 Subject: [PATCH] Test golfed from RT #128833. --- S17-promise/start.t | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/S17-promise/start.t b/S17-promise/start.t index 5c74c07f68..f74ac82426 100644 --- a/S17-promise/start.t +++ b/S17-promise/start.t @@ -1,7 +1,7 @@ use v6; use Test; -plan 49; +plan 50; throws-like { await }, Exception, "a bare await should not work"; @@ -147,3 +147,22 @@ dies-ok { await start { fail 'oh noe' } }, 'await rethrows failures'; sleep 1; is $*A,43,'dynamic variables modified inside start nested inside a block'; } + +# RT #128833 +{ + grammar G { + token TOP { .+ { make ~$/ } } + } + my $warned = False; + await do for ^300 { + start { + CONTROL { + when CX::Warn { + $warned = True; + } + } + G.parse("x" x 1000) + } + } + nok $warned, 'No spurious warnings when using closures in grammar rules'; +}