Skip to content

Commit

Permalink
Add test for #9148
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Dec 7, 2023
1 parent e7068a0 commit f16ea78
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/testcondition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5089,6 +5089,11 @@ class TestCondition : public TestFixture {
" return fwrite(s.c_str(), 1, s.length(), fp) == s.length();\n"
"}\n");
ASSERT_EQUALS("", errout.str());

check("void f(const std::string& s) {\n" // #9148
" if (s.empty() || s.size() < 1) {}\n"
"}\n");
ASSERT_EQUALS("[test.cpp:2] -> [test.cpp:2]: (style) Condition 's.size()<1' is always false\n", errout.str());
}

void alwaysTrueLoop()
Expand Down

0 comments on commit f16ea78

Please sign in to comment.