diff --git a/t/nqp/108-vmhash.t b/t/nqp/108-vmhash.t index f346527bc..7d49a02e3 100644 --- a/t/nqp/108-vmhash.t +++ b/t/nqp/108-vmhash.t @@ -1,4 +1,4 @@ -plan(54); +plan(55); my $backend := nqp::getcomp('nqp').backend.name; @@ -234,3 +234,16 @@ todo('Exceptions for iterators NYI on js', 2) if $backend eq 'js'; ok($msg ne "", 'iterator throws after end'); is($msg, 'Iteration past end of iterator', 'iterator throws correct exception after end'); + +$msg := ""; +try { + my $h := nqp::hash("a", 42); + my $i := nqp::iterator($h); + nqp::deletekey($h, "a"); + nqp::shift($i); + CATCH { + $msg := nqp::getmessage($_); + } +} + +ok($msg eq "", 'No SEGV or exception as a result of a misused hash iterator');