aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java
diff options
context:
space:
mode:
authorGravatar Laurent Le Brun <laurentlb@google.com>2015-03-24 10:04:50 +0000
committerGravatar Han-Wen Nienhuys <hanwen@google.com>2015-03-24 16:41:52 +0000
commit8fc603ca043a8faa97abbd9677866290807b7b6e (patch)
tree236081d562b868b911b59b34426502e5a128b6c4 /src/test/java
parentadeef73a97cf191301a7b563883a075caed733b7 (diff)
Skylark: Allow builtin functions to be shadowed.
This change makes them consistent with global variables. e.g. def foo(len): return len + 1 # now allowed Redefinition is still forbidden. -- MOS_MIGRATED_REVID=89383535
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/syntax/ValidationTests.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/ValidationTests.java b/src/test/java/com/google/devtools/build/lib/syntax/ValidationTests.java
index 45ff6f6b28..22b4325c59 100644
--- a/src/test/java/com/google/devtools/build/lib/syntax/ValidationTests.java
+++ b/src/test/java/com/google/devtools/build/lib/syntax/ValidationTests.java
@@ -624,22 +624,19 @@ public class ValidationTests extends AbstractParserTestCase {
@Test
public void testModulesReadOnlyInFuncDefBody() {
- checkError("Variable cmd_helper is read only",
- "def func():",
+ parse("def func():",
" cmd_helper = set()");
}
@Test
public void testBuiltinGlobalFunctionsReadOnlyInFuncDefBody() {
- checkError("Variable rule is read only",
- "def func():",
+ parse("def func():",
" rule = 'abc'");
}
@Test
public void testBuiltinGlobalFunctionsReadOnlyAsFuncDefArg() {
- checkError("Variable rule is read only",
- "def func(rule):",
+ parse("def func(rule):",
" return rule");
}