Skip to content

Commit d84cfde

Browse files
committed
add tests
1 parent ba0dca6 commit d84cfde

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

test/testtokenize.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ class TestTokenizer : public TestFixture {
439439
TEST_CASE(astcompound);
440440
TEST_CASE(astfuncdecl);
441441
TEST_CASE(astarrayinit);
442+
TEST_CASE(astbracedinit);
442443

443444
TEST_CASE(startOfExecutableScope);
444445

@@ -7535,6 +7536,12 @@ class TestTokenizer : public TestFixture {
75357536
ASSERT_EQUALS("a2[2[ 12, 34,{", testAst("int a[2][2]{ { 1, 2 }, { 3, 4 } };"));
75367537
}
75377538

7539+
void astbracedinit() {
7540+
ASSERT_EQUALS("intab{&", testAst("int &a { b };"));
7541+
ASSERT_EQUALS("inta0{&&", testAst("int &&a { 0 };"));
7542+
ASSERT_EQUALS("intanullptr{*", testAst("int *a { nullptr };"));
7543+
}
7544+
75387545
#define isStartOfExecutableScope(offset, code) isStartOfExecutableScope_(offset, code, __FILE__, __LINE__)
75397546
template<size_t size>
75407547
bool isStartOfExecutableScope_(int offset, const char (&code)[size], const char* file, int line) {

0 commit comments

Comments
 (0)