use of com.google.idea.blaze.base.model.primitives.TargetExpression in project intellij by bazelbuild.
the class WildcardTargetPatternTest method testNonWildcardPattern.
@Test
public void testNonWildcardPattern() {
TargetExpression target = TargetExpression.fromStringSafe("//java/com/google:single_target");
WildcardTargetPattern wildcardPattern = WildcardTargetPattern.fromExpression(target);
assertThat(wildcardPattern).isNull();
}
use of com.google.idea.blaze.base.model.primitives.TargetExpression in project intellij by bazelbuild.
the class WildcardTargetPatternTest method testRecursiveWildcardPatternAllTargetsAlternativeFormat.
@Test
public void testRecursiveWildcardPatternAllTargetsAlternativeFormat() {
TargetExpression target = TargetExpression.fromStringSafe("//java/com/google/...:*");
WildcardTargetPattern wildcardPattern = WildcardTargetPattern.fromExpression(target);
assertThat(wildcardPattern).isNotNull();
assertThat(wildcardPattern.coversPackage(new WorkspacePath("java/com/google"))).isTrue();
assertThat(wildcardPattern.coversPackage(new WorkspacePath("java/com/google/foo"))).isTrue();
assertThat(wildcardPattern.isRecursive()).isTrue();
assertThat(wildcardPattern.getBasePackage()).isEqualTo(new WorkspacePath("java/com/google"));
assertThat(wildcardPattern.rulesOnly()).isFalse();
}
use of com.google.idea.blaze.base.model.primitives.TargetExpression in project intellij by bazelbuild.
the class WildcardTargetPatternTest method testRecursiveWildcardPattern.
@Test
public void testRecursiveWildcardPattern() {
TargetExpression target = TargetExpression.fromStringSafe("//java/com/google/...");
WildcardTargetPattern wildcardPattern = WildcardTargetPattern.fromExpression(target);
assertThat(wildcardPattern).isNotNull();
assertThat(wildcardPattern.coversPackage(new WorkspacePath("java/com/google"))).isTrue();
assertThat(wildcardPattern.coversPackage(new WorkspacePath("java/com/google/foo"))).isTrue();
assertThat(wildcardPattern.isRecursive()).isTrue();
assertThat(wildcardPattern.getBasePackage()).isEqualTo(new WorkspacePath("java/com/google"));
assertThat(wildcardPattern.rulesOnly()).isTrue();
}
use of com.google.idea.blaze.base.model.primitives.TargetExpression in project intellij by bazelbuild.
the class WildcardTargetPatternTest method testNonWildcardImplicitTargetName.
@Test
public void testNonWildcardImplicitTargetName() {
TargetExpression target = TargetExpression.fromStringSafe("//java/com/google/foo");
WildcardTargetPattern wildcardPattern = WildcardTargetPattern.fromExpression(target);
assertThat(wildcardPattern).isNull();
}
use of com.google.idea.blaze.base.model.primitives.TargetExpression in project intellij by bazelbuild.
the class WildcardTargetPatternTest method testNonRecursiveWildcardPattern.
@Test
public void testNonRecursiveWildcardPattern() {
TargetExpression target = TargetExpression.fromStringSafe("//java/com/google:all");
WildcardTargetPattern wildcardPattern = WildcardTargetPattern.fromExpression(target);
assertThat(wildcardPattern).isNotNull();
assertThat(wildcardPattern.coversPackage(new WorkspacePath("java/com/google"))).isTrue();
assertThat(wildcardPattern.coversPackage(new WorkspacePath("java/com/google/foo"))).isFalse();
assertThat(wildcardPattern.isRecursive()).isFalse();
assertThat(wildcardPattern.getBasePackage()).isEqualTo(new WorkspacePath("java/com/google"));
assertThat(wildcardPattern.rulesOnly()).isTrue();
}
Aggregations