Skip to content

Commit 7888dac

Browse files
committed
ParseXS: refactor: re-add tests for C preamble
This earlier commit in the branch: ParseXS: refactor: inline and rm standard_XS_defs removed a test file which checked that the standard C preamble text was present. This commit re-adds those tests in a different way.
1 parent 7c119be commit 7888dac

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

dist/ExtUtils-ParseXS/t/001-basic.t

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5851,4 +5851,32 @@ EOF
58515851
test_many($preamble, undef, \@test_fns);
58525852
}
58535853

5854+
{
5855+
# Test standard C file preamble
5856+
# check that a few standard lines are present
5857+
5858+
my $preamble = Q(<<'EOF');
5859+
|MODULE = Foo PACKAGE = Foo
5860+
|
5861+
|PROTOTYPES: DISABLE
5862+
|
5863+
EOF
5864+
5865+
my @test_fns = (
5866+
[
5867+
"C preamble",
5868+
[ Q(<<'EOF') ],
5869+
|void foo()
5870+
EOF
5871+
5872+
[ 0, 0, qr{#ifndef PERL_UNUSED_VAR}, "PERL_UNUSED_VAR" ],
5873+
[ 0, 0, qr{#ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE},
5874+
"PERL_ARGS_ASSERT_CROAK_XS_USAGE" ],
5875+
[ 0, 0, qr{#ifdef newXS_flags}, "newXS_flags" ],
5876+
],
5877+
);
5878+
5879+
test_many($preamble, undef, \@test_fns);
5880+
}
5881+
58545882
done_testing;

0 commit comments

Comments
 (0)