From cf378fa4cf4089a9964939fe8055c9fdfbccc8aa Mon Sep 17 00:00:00 2001 From: Kaz Wesley Date: Fri, 7 Jun 2019 19:06:00 -0700 Subject: [PATCH] add tests for #2965 This will segfault until it's built on MoarVM/MoarVM#1116 --- t/04-nativecall/23-incomplete-types.t | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 t/04-nativecall/23-incomplete-types.t diff --git a/t/04-nativecall/23-incomplete-types.t b/t/04-nativecall/23-incomplete-types.t new file mode 100644 index 00000000000..aaca892a87e --- /dev/null +++ b/t/04-nativecall/23-incomplete-types.t @@ -0,0 +1,22 @@ +use v6; + +use MONKEY-SEE-NO-EVAL; + +use lib ; +use NativeCall :TEST; +use Test; + +plan 6; + +for () -> $cls { + # test the stub case + my $b = ( + "class Stub-$cls is repr('CStruct') " ~ 「{ ... }」, + "class Oops$cls" ~ 「 is repr('」 ~ $cls ~ 「') { HAS Stub-」 ~ $cls ~ 「 $.stubby; }」; + ).join("\n"); + throws-like { EVAL $b }, Exception, :message(/inline.*before.*definition/); + + # self-inlining should fail the same way + my $bad = ("class Oops2$cls is repr(", $cls, ') { HAS Oops2'~$cls~' $.more; }').join(「'」); + throws-like { EVAL $bad }, Exception, :message(/inline.*before.*definition/); +}