diff options
author | Shevek <[email protected]> | 2014-02-05 20:41:44 -0800 |
---|---|---|
committer | Shevek <[email protected]> | 2014-02-05 20:41:44 -0800 |
commit | ec176d2a623f274ad8b0d7962b88a2f7a67446ca (patch) | |
tree | 0ee864d492d997b3e00582dc5dc3c686a7f351f4 /src/test | |
parent | f2b03d6787e89255d68f5398a8a8e0d544f12405 (diff) |
Fix #13: Negative constants are not in the C99 standard.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/org/anarres/cpp/LexerSourceTest.java | 1 | ||||
-rw-r--r-- | src/test/java/org/anarres/cpp/NumericValueTest.java | 12 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/test/java/org/anarres/cpp/LexerSourceTest.java b/src/test/java/org/anarres/cpp/LexerSourceTest.java index f51b253..80abdd3 100644 --- a/src/test/java/org/anarres/cpp/LexerSourceTest.java +++ b/src/test/java/org/anarres/cpp/LexerSourceTest.java @@ -98,5 +98,6 @@ public class LexerSourceTest { testLexerSource("1e6", true, NUMBER); testLexerSource("1.45e6", true, NUMBER); testLexerSource(".45e6", true, NUMBER); + testLexerSource("-6", true, '-', NUMBER); } } diff --git a/src/test/java/org/anarres/cpp/NumericValueTest.java b/src/test/java/org/anarres/cpp/NumericValueTest.java index 9d6cbe4..5668452 100644 --- a/src/test/java/org/anarres/cpp/NumericValueTest.java +++ b/src/test/java/org/anarres/cpp/NumericValueTest.java @@ -54,16 +54,16 @@ public class NumericValueTest { testNumericValue("0x12L", 0x12); // Negative - testNumericValue("-0", 0); - testNumericValue("-1", -1); + // testNumericValue("-0", 0); + // testNumericValue("-1", -1); // Negative hex - testNumericValue("-0x56", -0x56); - testNumericValue("-0x102", -0x102); + // testNumericValue("-0x56", -0x56); + // testNumericValue("-0x102", -0x102); // Octal and negative octal testNumericValue("0673", Integer.parseInt("673", 8)); - testNumericValue("-0673", Integer.parseInt("-673", 8)); + // testNumericValue("-0673", Integer.parseInt("-673", 8)); // Floating point testNumericValue(".0", 0); @@ -75,7 +75,7 @@ public class NumericValueTest { // Sign on exponents testNumericValue("1e1", 1e1); - testNumericValue("-1e1", -1e1); + // testNumericValue("-1e1", -1e1); testNumericValue("1e-1", 1e-1); // Hex numbers with decimal exponents |