From 8e67b28e0f18250aa7d31fda616da3fe7fd67ce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Wed, 8 Jun 2022 21:25:13 +0200 Subject: [PATCH] Make the checks that detect if a docs snippet should compile a bit more robust against comments --- test/cmdlineTests.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/cmdlineTests.sh b/test/cmdlineTests.sh index 91b233b89..250d10a6e 100755 --- a/test/cmdlineTests.sh +++ b/test/cmdlineTests.sh @@ -517,15 +517,16 @@ SOLTMPDIR=$(mktemp -d) opts=() # We expect errors if explicitly stated, or if imports # are used (in the style guide) - if grep -E "This will not compile|import \"" "$f" >/dev/null + if grep -E "// This will not compile" "$f" >/dev/null || + sed -e 's|//.*||g' "$f" | grep -E "import \"" >/dev/null then opts=(--expect-errors) fi - if grep "This will report a warning" "$f" >/dev/null + if grep "// This will report a warning" "$f" >/dev/null then opts+=(--expect-warnings) fi - if grep "This may report a warning" "$f" >/dev/null + if grep "// This may report a warning" "$f" >/dev/null then opts+=(--ignore-warnings) fi