Skip to content

Instantly share code, notes, and snippets.

@jnthn

jnthn/test.p6 Secret

Created September 5, 2019 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnthn/51f33103301b41bdcc6d1695f92f9b62 to your computer and use it in GitHub Desktop.
Save jnthn/51f33103301b41bdcc6d1695f92f9b62 to your computer and use it in GitHub Desktop.
use Test;
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';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment