Skip to content

Commit

Permalink
add tests for rakudo#2965
Browse files Browse the repository at this point in the history
This will segfault until it's built on MoarVM/MoarVM#1116
  • Loading branch information
kazcw committed Jun 9, 2019
1 parent c0c99e7 commit cf378fa
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions t/04-nativecall/23-incomplete-types.t
@@ -0,0 +1,22 @@
use v6;

use MONKEY-SEE-NO-EVAL;

use lib <lib>;
use NativeCall :TEST;
use Test;

plan 6;

for (<CUnion CStruct CPPStruct>) -> $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/);
}

0 comments on commit cf378fa

Please sign in to comment.