Test case to demonstrate #3294
This commit is contained in:
parent
b96ab6ba26
commit
2a46c635f6
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue