From c06119b6d97f700f3843b5b5e5679ff522b47963 Mon Sep 17 00:00:00 2001 From: Shevek Date: Sun, 19 Jan 2014 09:48:40 -0800 Subject: Finally fix octal floating point. --- src/test/java/org/anarres/cpp/NumericValueTest.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/test') diff --git a/src/test/java/org/anarres/cpp/NumericValueTest.java b/src/test/java/org/anarres/cpp/NumericValueTest.java index 7907457..9d6cbe4 100644 --- a/src/test/java/org/anarres/cpp/NumericValueTest.java +++ b/src/test/java/org/anarres/cpp/NumericValueTest.java @@ -78,13 +78,20 @@ public class NumericValueTest { testNumericValue("-1e1", -1e1); testNumericValue("1e-1", 1e-1); - // Based numbers with exponents - // testNumericValue("012e3", 012e3); // Fails + // Hex numbers with decimal exponents testNumericValue("0x12e3", 0x12e3); testNumericValue("0x12p3", 0x12p3); - // Octal prefix with decimal suffix - // testNumericValue("067e8", 067e8); // Fails + // Octal numbers with decimal exponents + testNumericValue("012e3", 012e3); // Fails + testNumericValue("067e4", 067e4); // Fails + + // Issues a warning. + try { + testNumericValue("097", 97); + fail("No warning."); + } catch (LexerException e) { + } } } -- cgit v1.2.3