TestMathLib: added robustness tests for testing MathLib::isFloat. Ensure it works correctly for preceeding and trailing white spaces.
This commit is contained in:
parent
01730d4d16
commit
c3a08bf108
|
@ -360,7 +360,15 @@ private:
|
|||
ASSERT_EQUALS(false, MathLib::isFloat(""));
|
||||
|
||||
ASSERT_EQUALS(false, MathLib::isFloat("0"));
|
||||
ASSERT_EQUALS(false, MathLib::isFloat("0 "));
|
||||
ASSERT_EQUALS(false, MathLib::isFloat(" 0 "));
|
||||
ASSERT_EQUALS(false, MathLib::isFloat(" 0"));
|
||||
|
||||
ASSERT_EQUALS(true , MathLib::isFloat("0."));
|
||||
ASSERT_EQUALS(true , MathLib::isFloat("0. "));
|
||||
ASSERT_EQUALS(true , MathLib::isFloat(" 0. "));
|
||||
ASSERT_EQUALS(true , MathLib::isFloat(" 0."));
|
||||
|
||||
ASSERT_EQUALS(true , MathLib::isFloat("0.0"));
|
||||
ASSERT_EQUALS(true , MathLib::isFloat("-0."));
|
||||
ASSERT_EQUALS(true , MathLib::isFloat("+0."));
|
||||
|
|
Loading…
Reference in New Issue