Skip to content

Commit 046aa9c

Browse files
Update testtokenize.cpp
1 parent 5e6d0a2 commit 046aa9c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

test/testtokenize.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ class TestTokenizer : public TestFixture {
426426
TEST_CASE(astrvaluedecl);
427427
TEST_CASE(astorkeyword);
428428
TEST_CASE(astenumdecl);
429+
TEST_CASE(astcompound);
429430

430431
TEST_CASE(startOfExecutableScope);
431432

@@ -7422,6 +7423,11 @@ class TestTokenizer : public TestFixture {
74227423
ASSERT_EQUALS("A0U=", testAst("enum myclass : unsigned char { A = 0U, };"));
74237424
}
74247425

7426+
void astcompound() {
7427+
ASSERT_EQUALS("sn0=={(tmp:?=", testAst("Str s = n == 0 ? (Str) { 0 } : tmp;")); // #14548
7428+
ASSERT_EQUALS("s(sstrlens(0:?,{(return", testAst("return (struct Str) { (unsigned char*)s, s ? strlen(s) : 0 };"));
7429+
}
7430+
74257431
#define isStartOfExecutableScope(offset, code) isStartOfExecutableScope_(offset, code, __FILE__, __LINE__)
74267432
template<size_t size>
74277433
bool isStartOfExecutableScope_(int offset, const char (&code)[size], const char* file, int line) {

0 commit comments

Comments
 (0)