From b666937cd1d66fca485f3dcc467eb0d55ceaa21b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludvig=20Gunne=20Lindstr=C3=B6m?= Date: Tue, 14 Jul 2026 11:02:50 +0200 Subject: [PATCH] add test --- test/testtokenize.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index c4de2be00e7..f1a2a85e212 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -92,6 +92,7 @@ class TestTokenizer : public TestFixture { TEST_CASE(tokenize40); // #13181 TEST_CASE(tokenize41); // #13847 TEST_CASE(tokenize42); // #13861 + TEST_CASE(tokenize43); // #13861 TEST_CASE(validate); @@ -941,6 +942,12 @@ class TestTokenizer : public TestFixture { (void)errout_str(); } + void tokenize43() { + const char code[] = "void f(int i) { do if (i &= 1) {} while (0); }"; + ASSERT_NO_THROW(tokenizeAndStringify(code)); + (void)errout_str(); + } + void validate() { // C++ code in C file ASSERT_THROW_INTERNAL(tokenizeAndStringify(";using namespace std;",dinit(TokenizeOptions, $.expand = false, $.cpp = false)), SYNTAX);