use of com.google.devtools.build.lib.syntax.Type.ConversionException in project bazel by bazelbuild.
the class BuildTypeTest method testLabelKeyedStringDictErrorConvertingMapWithMultipleEquivalentKeysIncludesContext.
@Test
public void testLabelKeyedStringDictErrorConvertingMapWithMultipleEquivalentKeysIncludesContext() throws Exception {
Label context = Label.parseAbsolute("//current/package:this");
Map<String, String> input = new ImmutableMap.Builder<String, String>().put(":reference", "value1").put("//current/package:reference", "value2").build();
try {
BuildType.LABEL_KEYED_STRING_DICT.convert(input, "flag map", context);
fail("Expected a conversion exception to be thrown.");
} catch (ConversionException expected) {
assertThat(expected).hasMessage("duplicate labels in flag map: //current/package:reference " + "(as [\":reference\", \"//current/package:reference\"])");
}
}
Aggregations