Skip to content

Commit 3bff1fc

Browse files
committed
add tests
1 parent 515c73e commit 3bff1fc

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

test/testother.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3902,6 +3902,9 @@ class TestOther : public TestFixture {
39023902
"[test.cpp:7:10]: (style) Parameter 't' can be declared as reference to const [constParameterReference]\n"
39033903
"[test.cpp:10:25]: (style) Parameter 'v' can be declared as reference to const [constParameterReference]\n",
39043904
errout_str());
3905+
3906+
check("void push(V& v) { v.push_back({ .x = 1 }); }"); // #14010
3907+
ASSERT_EQUALS("", errout_str());
39053908
}
39063909

39073910
void constParameterCallback() {

test/testtokenize.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ class TestTokenizer : public TestFixture {
403403
TEST_CASE(astvardecl);
404404
TEST_CASE(astnewscoped);
405405
TEST_CASE(astdecltypescope);
406+
TEST_CASE(astdesignatedinit);
406407

407408
TEST_CASE(startOfExecutableScope);
408409

@@ -7176,6 +7177,10 @@ class TestTokenizer : public TestFixture {
71767177
ASSERT_EQUALS("sizedecltypethism_P.(XSize::::{", testAst("size { decltype(this->m_P)::X::Size };"));
71777178
}
71787179

7180+
void astdesignatedinit() {
7181+
ASSERT_EQUALS("(( f ({ (= (. x) 1)))", testAst("f({ .x = 1 });", AstStyle::Z3));
7182+
}
7183+
71797184
#define isStartOfExecutableScope(offset, code) isStartOfExecutableScope_(offset, code, __FILE__, __LINE__)
71807185
template<size_t size>
71817186
bool isStartOfExecutableScope_(int offset, const char (&code)[size], const char* file, int line) {

0 commit comments

Comments
 (0)