summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorShevek <[email protected]>2014-01-19 09:48:40 -0800
committerShevek <[email protected]>2014-01-19 09:48:40 -0800
commitc06119b6d97f700f3843b5b5e5679ff522b47963 (patch)
tree3b3760d9c5c582a2c3ce5caf2c95f56027051d36 /src/test
parentba46db6bbe54aa0ac97ba3a4567617b143750c0a (diff)
Finally fix octal floating point.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/anarres/cpp/NumericValueTest.java15
1 files changed, 11 insertions, 4 deletions
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) {
+ }
}
}