aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build
diff options
context:
space:
mode:
authorGravatar laurentlb <laurentlb@google.com>2017-06-14 17:46:47 +0200
committerGravatar Yun Peng <pcloudy@google.com>2017-06-16 09:26:26 +0200
commitc03c1f57331bc5381c8e08e4a1b7fbb5a7fe9223 (patch)
tree1b28443ca9e954ddf6ad1711f4e8624d3fc19174 /src/test/java/com/google/devtools/build
parent4cbe5f36d32d462d9dd269232a520f8ac33cba65 (diff)
Add support for the '0o' octal prefix for integers.
RELNOTES: Octal prefix '0' is deprecated in favor of '0o' (use 0o777 instead of 0777). PiperOrigin-RevId: 158982649
Diffstat (limited to 'src/test/java/com/google/devtools/build')
-rw-r--r--src/test/java/com/google/devtools/build/lib/syntax/LexerTest.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/LexerTest.java b/src/test/java/com/google/devtools/build/lib/syntax/LexerTest.java
index bde212cc42..ce768b22d8 100644
--- a/src/test/java/com/google/devtools/build/lib/syntax/LexerTest.java
+++ b/src/test/java/com/google/devtools/build/lib/syntax/LexerTest.java
@@ -184,12 +184,18 @@ public class LexerTest {
// octal
assertThat(values(tokens("012345-"))).isEqualTo("INT(5349) MINUS NEWLINE EOF");
+ assertThat(values(tokens("0o12345-"))).isEqualTo("INT(5349) MINUS NEWLINE EOF");
+ assertThat(values(tokens("0O77"))).isEqualTo("INT(63) NEWLINE EOF");
// octal (bad)
assertThat(values(tokens("012349-"))).isEqualTo("INT(0) MINUS NEWLINE EOF");
assertThat(lastError.toString())
.isEqualTo("/some/path.txt:1: invalid base-8 integer constant: 012349");
+ assertThat(values(tokens("0o"))).isEqualTo("INT(0) NEWLINE EOF");
+ assertThat(lastError.toString())
+ .isEqualTo("/some/path.txt:1: invalid base-8 integer constant: 0o");
+
// hexadecimal (uppercase)
assertThat(values(tokens("0X12345F-"))).isEqualTo("INT(1193055) MINUS NEWLINE EOF");