Test case to demonstrate #3294

This commit is contained in:
Thomas Jarosch 2011-11-05 14:04:23 +01:00
parent b96ab6ba26
commit 2a46c635f6
1 changed files with 8 additions and 0 deletions

View File

@ -34,6 +34,7 @@ private:
void run() {
TEST_CASE(nextprevious);
TEST_CASE(multiCompare);
TEST_CASE(multiCompare2); // #3294 - false negative multi compare between "=" and "=="
TEST_CASE(getStrLength);
TEST_CASE(strValue);
@ -103,6 +104,13 @@ private:
ASSERT_EQUALS(-1, Token::multiCompare("%op%|two", "x"));
}
void multiCompare2() { // #3294
// Original pattern that failed: [[,(=<>+-*|&^] %num% [+-*/] %num% ]|,|)|;|=|%op%
givenACodeSampleToTokenize toks("a == 1");
// FIXME: Result should be true
ASSERT_EQUALS(false, Token::Match(toks.tokens(), "a =|%op%"));
}
void getStrLength() {
Token tok(0);