aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build
diff options
context:
space:
mode:
authorGravatar laurentlb <laurentlb@google.com>2017-07-04 09:04:14 -0400
committerGravatar John Cater <jcater@google.com>2017-07-05 10:58:04 -0400
commit7a6ec8e9ab2a0f9c60c9394831619335d9ed5760 (patch)
tree2018de2073a6a8fffabf77c9f442ba1ee5cf40c0 /src/test/java/com/google/devtools/build
parentd381624d33d6548daa545be4c038279ee226394d (diff)
Forbid tabs for indentation
RELNOTES[INC]: Using tabulation for identation is now fobidden in .bzl files PiperOrigin-RevId: 160888064
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 0fd91df959..0417074abc 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
@@ -356,6 +356,12 @@ public class LexerTest {
}
@Test
+ public void testIndentationWithTab() throws Exception {
+ tokens("def x():\n\tpass");
+ assertThat(lastError.toString()).contains("Tabulations are not allowed");
+ }
+
+ @Test
public void testIndentationWithCrLf() throws Exception {
assertThat(values(tokens("1\r\n 2\r\n")))
.isEqualTo("INT(1) NEWLINE INDENT INT(2) NEWLINE OUTDENT NEWLINE EOF");