diff options
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/syntax')
3 files changed, 15 insertions, 14 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/PrinterTest.java b/src/test/java/com/google/devtools/build/lib/syntax/PrinterTest.java index d6c165931b..3609c0c8be 100644 --- a/src/test/java/com/google/devtools/build/lib/syntax/PrinterTest.java +++ b/src/test/java/com/google/devtools/build/lib/syntax/PrinterTest.java @@ -61,8 +61,9 @@ public class PrinterTest { assertThat(Printer.repr(3)).isEqualTo("3"); assertThat(Printer.repr(Runtime.NONE)).isEqualTo("None"); - assertThat(Printer.str(Label.parseAbsolute("//x"))).isEqualTo("//x:x"); - assertThat(Printer.repr(Label.parseAbsolute("//x"))).isEqualTo("Label(\"//x:x\")"); + assertThat(Printer.str(Label.parseAbsolute("//x", ImmutableMap.of()))).isEqualTo("//x:x"); + assertThat(Printer.repr(Label.parseAbsolute("//x", ImmutableMap.of()))) + .isEqualTo("Label(\"//x:x\")"); List<?> list = MutableList.of(null, "foo", "bar"); List<?> tuple = Tuple.of("foo", "bar"); diff --git a/src/test/java/com/google/devtools/build/lib/syntax/SkylarkImportsTest.java b/src/test/java/com/google/devtools/build/lib/syntax/SkylarkImportsTest.java index cb8629c143..813c727428 100644 --- a/src/test/java/com/google/devtools/build/lib/syntax/SkylarkImportsTest.java +++ b/src/test/java/com/google/devtools/build/lib/syntax/SkylarkImportsTest.java @@ -99,9 +99,10 @@ public class SkylarkImportsTest { assertThat(importForLabel.getImportString()).named("getImportString()").isEqualTo(labelString); // The import label is relative to the parent's package, not the parent's directory. - Label containingLabel = Label.parseAbsolute(containingLabelString); - assertThat(importForLabel.getLabel(containingLabel)).named("getLabel()") - .isEqualTo(Label.parseAbsolute(expectedLabelString)); + Label containingLabel = Label.parseAbsolute(containingLabelString, ImmutableMap.of()); + assertThat(importForLabel.getLabel(containingLabel)) + .named("getLabel()") + .isEqualTo(Label.parseAbsolute(expectedLabelString, ImmutableMap.of())); assertThat(importForLabel.asPathFragment()).named("asPathFragment()") .isEqualTo(PathFragment.create(expectedPathString)); diff --git a/src/test/java/com/google/devtools/build/lib/syntax/TypeTest.java b/src/test/java/com/google/devtools/build/lib/syntax/TypeTest.java index a7c45f436b..0fd54903f6 100644 --- a/src/test/java/com/google/devtools/build/lib/syntax/TypeTest.java +++ b/src/test/java/com/google/devtools/build/lib/syntax/TypeTest.java @@ -48,7 +48,7 @@ public class TypeTest { @Before public final void setCurrentRule() throws Exception { - this.currentRule = Label.parseAbsolute("//quux:baz"); + this.currentRule = Label.parseAbsolute("//quux:baz", ImmutableMap.of()); } @Test @@ -220,16 +220,14 @@ public class TypeTest { @Test public void testLabel() throws Exception { - Label label = Label - .parseAbsolute("//foo:bar"); + Label label = Label.parseAbsolute("//foo:bar", ImmutableMap.of()); assertThat(BuildType.LABEL.convert("//foo:bar", null, currentRule)).isEqualTo(label); assertThat(collectLabels(BuildType.LABEL, label)).containsExactly(label); } @Test public void testNodepLabel() throws Exception { - Label label = Label - .parseAbsolute("//foo:bar"); + Label label = Label.parseAbsolute("//foo:bar", ImmutableMap.of()); assertThat(BuildType.NODEP_LABEL.convert("//foo:bar", null, currentRule)).isEqualTo(label); assertThat(collectLabels(BuildType.NODEP_LABEL, label)).containsExactly(label); } @@ -237,9 +235,9 @@ public class TypeTest { @Test public void testRelativeLabel() throws Exception { assertThat(BuildType.LABEL.convert(":wiz", null, currentRule)) - .isEqualTo(Label.parseAbsolute("//quux:wiz")); + .isEqualTo(Label.parseAbsolute("//quux:wiz", ImmutableMap.of())); assertThat(BuildType.LABEL.convert("wiz", null, currentRule)) - .isEqualTo(Label.parseAbsolute("//quux:wiz")); + .isEqualTo(Label.parseAbsolute("//quux:wiz", ImmutableMap.of())); try { BuildType.LABEL.convert("wiz", null); fail(); @@ -336,8 +334,9 @@ public class TypeTest { List<Label> converted = BuildType.LABEL_LIST.convert(input , null, currentRule); List<Label> expected = - Arrays.asList(Label.parseAbsolute("//foo:bar"), - Label.parseAbsolute("//quux:wiz")); + Arrays.asList( + Label.parseAbsolute("//foo:bar", ImmutableMap.of()), + Label.parseAbsolute("//quux:wiz", ImmutableMap.of())); assertThat(converted).isEqualTo(expected); assertThat(converted).isNotSameAs(expected); assertThat(collectLabels(BuildType.LABEL_LIST, converted)).containsExactlyElementsIn(expected); |