Skip to content

Commit

Permalink
Update testsimplifytokens.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github authored Apr 4, 2024
1 parent 3dd6531 commit 35c4625
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/testsimplifytokens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class TestSimplifyTokens : public TestFixture {
TEST_CASE(simplifyNestedNamespace);
TEST_CASE(simplifyNamespaceAliases1);
TEST_CASE(simplifyNamespaceAliases2); // ticket #10281
TEST_CASE(simplifyNamespaceAliases3);

TEST_CASE(simplifyKnownVariables2);
TEST_CASE(simplifyKnownVariables3);
Expand Down Expand Up @@ -1479,6 +1480,18 @@ class TestSimplifyTokens : public TestFixture {
"}"));
}

void simplifyNamespaceAliases3() {
ASSERT_EQUALS("namespace N { namespace O { int g ( ) ; } } " // #12586
"void f ( ) { "
"int s ; s = 3 * :: N :: O :: g ( ) ; "
"}",
tok("namespace N { namespace O { int g(); } }\n"
"namespace _n = ::N::O;\n"
"void f() {\n"
" int s = 3 * ::_n::g();\n"
"}\n"));
}

#define simplifyKnownVariables(code) simplifyKnownVariables_(code, __FILE__, __LINE__)
std::string simplifyKnownVariables_(const char code[], const char* file, int line) {
Tokenizer tokenizer(settings0, this);
Expand Down

0 comments on commit 35c4625

Please sign in to comment.