diff options
author | 2015-06-12 13:01:16 +0000 | |
---|---|---|
committer | 2015-06-15 10:47:59 +0000 | |
commit | 45deb33b92aa92f46e494a7cd4379b7040468883 (patch) | |
tree | 90c7d65af3d283f6b13fcb959a10afc8a75b9004 /src/test/java/com/google/devtools/build/lib/syntax | |
parent | 225030849d61c7cc6f7a09e93654f316cf33b1df (diff) |
Skylark: First argument of load() may no longer start with two slashes ("//")
--
MOS_MIGRATED_REVID=95833265
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/syntax')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/syntax/ValidationTests.java | 12 |
1 files changed, 12 insertions, 0 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 3326fec778..d7b4316185 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 @@ -316,6 +316,18 @@ public class ValidationTests extends EvaluationTestCase { } @Test + public void testLoadWithTooManySlashes() throws Exception { + String error = + "First argument of load() is a path, not a label. " + + "It should start with a single slash if it is an absolute path."; + + checkError(error, "load('//', 'a')\n"); + checkError(error, "load('//extension', 'a')\n"); + checkError(error, "load('///', 'a')\n"); + checkError(error, "load('///extension', 'a')\n"); + } + + @Test public void testLoadRelativePathOneSegment() throws Exception { parse("load('extension', 'a')\n"); } |