use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.
the class BuiltInRuleAnnotatorTest method testMissingMandatoryAttributeError.
@Test
public void testMissingMandatoryAttributeError() {
specProvider.setRules(ImmutableMap.of(JAVA_TEST.name, JAVA_TEST));
BuildFile file = createBuildFile(new WorkspacePath("java/com/google/BUILD"), "java_test(", " srcs = ['src'],", " neverlink = 0,", ")");
assertHasError(file, "Target missing required attribute(s): name");
}
use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.
the class BuiltInRuleAnnotatorTest method testUnresolvedValueInsideParenthesizedExpression.
@Test
public void testUnresolvedValueInsideParenthesizedExpression() {
specProvider.setRules(ImmutableMap.of(JAVA_TEST.name, JAVA_TEST));
BuildFile file = createBuildFile(new WorkspacePath("java/com/google/BUILD"), "java_test(", " name = (ref),", ")");
assertNoErrors(file);
}
use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.
the class BuiltInRuleAnnotatorTest method testGlobTreatedAsList.
@Test
public void testGlobTreatedAsList() {
specProvider.setRules(ImmutableMap.of(JAVA_TEST.name, JAVA_TEST));
BuildFile file = createBuildFile(new WorkspacePath("java/com/google/BUILD"), "java_test(", " name = 'import',", " srcs = glob(['src']),", " neverlink = 0,", ")");
assertNoErrors(file);
}
use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.
the class BuiltInRuleAnnotatorTest method testInvalidAttributeTypeError.
@Test
public void testInvalidAttributeTypeError() {
specProvider.setRules(ImmutableMap.of(JAVA_TEST.name, JAVA_TEST));
BuildFile file = createBuildFile(new WorkspacePath("java/com/google/BUILD"), "java_test(", " name = 'import',", " srcs = 'src',", " neverlink = 0,", ")");
assertHasError(file, String.format("Invalid value for attribute 'srcs'. Expected a value of type '%s'", Discriminator.LABEL_LIST));
}
use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.
the class BuiltInRuleAnnotatorTest method testNoMissingMandatoryArgErrorIfKwargsPresent.
@Test
public void testNoMissingMandatoryArgErrorIfKwargsPresent() {
specProvider.setRules(ImmutableMap.of(JAVA_TEST.name, JAVA_TEST));
BuildFile file = createBuildFile(new WorkspacePath("java/com/google/BUILD"), "def java_test(srcs=[], **kwargs):", " native.java_test(srcs = srcs, **kwargs)");
assertNoErrors(file);
}
Aggregations