Testtoken:matchNumeric(): extended testing about some missing testcases.

This commit is contained in:
orbitcowboy 2013-09-30 15:55:36 -07:00
parent 5a158987ce
commit b6d7e797a2
1 changed files with 15 additions and 0 deletions

View File

@ -422,6 +422,15 @@ private:
givenACodeSampleToTokenize doublePrecision("0.0d", true); givenACodeSampleToTokenize doublePrecision("0.0d", true);
ASSERT_EQUALS(true, Token::Match(doublePrecision.tokens(), "%num%")); ASSERT_EQUALS(true, Token::Match(doublePrecision.tokens(), "%num%"));
givenACodeSampleToTokenize signedLong("0L", true);
ASSERT_EQUALS(true, Token::Match(signedLong.tokens(), "%num%"));
givenACodeSampleToTokenize negativeSignedLong("-0L", true);
ASSERT_EQUALS(true, Token::Match(negativeSignedLong.tokens(), "- %num%"));
givenACodeSampleToTokenize positiveSignedLong("+0L", true);
ASSERT_EQUALS(true, Token::Match(positiveSignedLong.tokens(), "+ %num%"));
givenACodeSampleToTokenize unsignedInt("0U", true); givenACodeSampleToTokenize unsignedInt("0U", true);
ASSERT_EQUALS(true, Token::Match(unsignedInt.tokens(), "%num%")); ASSERT_EQUALS(true, Token::Match(unsignedInt.tokens(), "%num%"));
@ -436,6 +445,12 @@ private:
givenACodeSampleToTokenize negative("-42", true); givenACodeSampleToTokenize negative("-42", true);
ASSERT_EQUALS(true, Token::Match(negative.tokens(), "- %num%")); ASSERT_EQUALS(true, Token::Match(negative.tokens(), "- %num%"));
givenACodeSampleToTokenize negativeNull("-.0", true);
ASSERT_EQUALS(true, Token::Match(negativeNull.tokens(), "- %num%"));
givenACodeSampleToTokenize positiveNull("+.0", true);
ASSERT_EQUALS(true, Token::Match(positiveNull.tokens(), "+ %num%"));
} }