From 618eefb48251043064b3dd2f3f15e41d49f70522 Mon Sep 17 00:00:00 2001 From: Jonathan Worthington Date: Thu, 5 Sep 2019 17:45:52 +0200 Subject: [PATCH] Test Proc.[Bool|Sink] accounts for signal Covers https://github.com/rakudo/rakudo/issues/3149. --- S29-os/system.t | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/S29-os/system.t b/S29-os/system.t index de33b37d6c..ed09e4952f 100644 --- a/S29-os/system.t +++ b/S29-os/system.t @@ -6,7 +6,7 @@ use Test::Util; # L # system is renamed to run, so link there. -plan 39; +plan 41; my $res; @@ -204,4 +204,14 @@ subtest 'Proc.pid is set correctly' => { isnt $pid, $p.pid, ".pid property updates with shell's PID on failed shell()"; } +# https://github.com/rakudo/rakudo/issues/3149 +{ + my $proc = run $*EXECUTABLE, ‘-e’, + ‘use NativeCall; sub strdup(int64) is native(Str) {*}; strdup(0)’; + throws-like { sink $proc }, + X::Proc::Unsuccessful, + 'Exit with a segfault makes the Proc throw in sink context'; + nok $proc, 'Exit with a segfault makes the Proc false'; +} + # vim: ft=perl6