diff options
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java b/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java index 81fa580ecb..ba6fd69add 100644 --- a/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java +++ b/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java @@ -1520,4 +1520,20 @@ public class SkylarkEvaluationTest extends EvaluationTest { eval("def foo():", " a = 10", " b = [a for a in range(3)]", " return a", "x = foo()"); assertThat(lookup("x")).isEqualTo(2); } + + @Test + public void testLoadStatementWithAbsolutePath() throws Exception { + env = newEnvironmentWithSkylarkOptions("--incompatible_load_argument_is_label"); + checkEvalErrorContains( + "First argument of 'load' must be a label and start with either '//' or ':'", + "load('/tmp/foo', 'arg')"); + } + + @Test + public void testLoadStatementWithRelativePath() throws Exception { + env = newEnvironmentWithSkylarkOptions("--incompatible_load_argument_is_label"); + checkEvalErrorContains( + "First argument of 'load' must be a label and start with either '//' or ':'", + "load('foo', 'arg')"); + } } |