Test zero exponents with and without signs.
This commit is contained in:
parent
f56618a281
commit
ea1b58b560
|
@ -972,6 +972,20 @@ static void test_VarParseNumFromStr(void)
|
|||
EXPECT(1,NUMPRS_EXPONENT,NUMPRS_EXPONENT,5,0,1);
|
||||
EXPECT2(1,FAILDIG);
|
||||
|
||||
/* The same for zero exponents */
|
||||
CONVERT("1e0", NUMPRS_EXPONENT);
|
||||
EXPECT(1,NUMPRS_EXPONENT,NUMPRS_EXPONENT,3,0,0);
|
||||
EXPECT2(1,FAILDIG);
|
||||
|
||||
/* Sign on a zero exponent doesn't matter */
|
||||
CONVERT("1e+0", NUMPRS_EXPONENT);
|
||||
EXPECT(1,NUMPRS_EXPONENT,NUMPRS_EXPONENT,4,0,0);
|
||||
EXPECT2(1,FAILDIG);
|
||||
|
||||
CONVERT("1e-0", NUMPRS_EXPONENT);
|
||||
EXPECT(1,NUMPRS_EXPONENT,NUMPRS_EXPONENT,4,0,0);
|
||||
EXPECT2(1,FAILDIG);
|
||||
|
||||
/* Doesn't consume a real number exponent */
|
||||
CONVERT("1e1.", NUMPRS_EXPONENT);
|
||||
EXPECT(1,NUMPRS_EXPONENT,NUMPRS_EXPONENT,3,0,1);
|
||||
|
|
Loading…
Reference in New Issue