Skip to content

Commit e13e35b

Browse files
committed
Allow LAX running of compilation tests
1 parent a208137 commit e13e35b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

xt/examples-compilation.rakutest

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ avoid requiring a body.
2424
Skip any bits marked C<:skip-test> unless the environment variable
2525
C<RAKU_DOC_TEST_FUDGE> is set to a true value.
2626
27+
Complain about any stylistic issues unless the environment variable
28+
C<RAKU_DOC_TEST_LAX> is set to a true value.
29+
2730
Note: This test generates a lot of noisy output to stderr; we
2831
do hide $*ERR, but some of these are emitted from parts of
2932
the compiler that only know about the low level handle, not the
@@ -57,22 +60,21 @@ sub test-example ($eg) {
5760
next;
5861
}
5962
# #1355 - don't like .WHAT in examples
60-
if ! $eg<ok-test>.contains('WHAT') && $eg<contents>.contains('.WHAT') {
63+
if !%*ENV<RAKU_DOC_TEST_LAX> && !$eg<ok-test>.contains('WHAT') && $eg<contents>.contains('.WHAT') {
6164
flunk "$eg<file> chunk starting with «" ~ starts-with($eg<contents>) ~ '» uses .WHAT: try .^name instead';
6265
next;
6366
}
64-
if ! $eg<ok-test>.contains('dd') && $eg<contents> ~~ / << 'dd' >> / {
67+
if !%*ENV<RAKU_DOC_TEST_LAX> && !$eg<ok-test>.contains('dd') && $eg<contents> ~~ / << 'dd' >> / {
6568
flunk "$eg<file> chunk starting with «" ~ starts-with($eg<contents>) ~ '» uses dd: try say instead';
6669
next;
6770
}
6871
# #3309 - don't like .perl in examples
69-
if ! $eg<ok-test>.contains('perl') && $eg<contents>.contains('.perl') {
72+
if !%*ENV<RAKU_DOC_TEST_LAX> && !$eg<ok-test>.contains('perl') && $eg<contents>.contains('.perl') {
7073
flunk "$eg<file> chunk starting with «" ~ starts-with($eg<contents>) ~ '» uses .perl: use .raku instead';
7174
next;
7275
}
73-
7476
# #1189 - don't use "multi sub"
75-
if ! $eg<ok-test>.contains('multi') && $eg<contents>.contains('multi sub') {
77+
if !%*ENV<RAKU_DOC_TEST_LAX> && !$eg<ok-test>.contains('multi') && $eg<contents>.contains('multi sub') {
7678
flunk "$eg<file> chunk $eg<count>" ~ ' uses multi sub: use multi instead';
7779
next;
7880
}

0 commit comments

Comments
 (0)