From b6d7e797a2b63ac54acd7f973382df8efb317022 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Mon, 30 Sep 2013 15:55:36 -0700 Subject: [PATCH] Testtoken:matchNumeric(): extended testing about some missing testcases. --- test/testtoken.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/testtoken.cpp b/test/testtoken.cpp index 229797f2c..147de46f9 100644 --- a/test/testtoken.cpp +++ b/test/testtoken.cpp @@ -422,6 +422,15 @@ private: givenACodeSampleToTokenize doublePrecision("0.0d", true); 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); ASSERT_EQUALS(true, Token::Match(unsignedInt.tokens(), "%num%")); @@ -436,6 +445,12 @@ private: givenACodeSampleToTokenize negative("-42", true); 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%")); }