use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.
the class TestTargetSourcesHeuristicTest method testPredicateNoSources.
@Test
public void testPredicateNoSources() {
File source = workspaceRoot.fileForPath(new WorkspacePath("java/com/foo/FooTest.java"));
TargetInfo target = TargetIdeInfo.builder().setLabel("//foo:test").setKind("java_test").build().toTargetInfo();
assertThat(new TestTargetSourcesHeuristic().matchesSource(project, target, null, source, null)).isFalse();
}
use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.
the class BuildTargetFinderTest method buildFileFindsSelf.
@Test
public void buildFileFindsSelf() {
BuildTargetFinder buildTargetFinder = buildTargetFinder(ImmutableList.of(new WorkspacePath(".")));
fileOperationProvider.addFiles(new File("/root/j/c/g/some/BUILD"), new File("/root/j/c/g/BUILD"));
assertThat(buildTargetFinder.findTargetForFile(new File("/root/j/c/g/some/BUILD"))).isEqualTo(TargetExpression.fromStringSafe("//j/c/g/some:all"));
}
use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.
the class BuildTargetFinderTest method firstBuildFileInDirectoryIsFound.
@Test
public void firstBuildFileInDirectoryIsFound() {
BuildTargetFinder buildTargetFinder = buildTargetFinder(ImmutableList.of(new WorkspacePath(".")));
fileOperationProvider.addFiles(new File("/root/j/c/g/some/BUILD"), new File("/root/j/c/g/BUILD"), new File("/root/j/c/g/some/dir/File.java"));
assertThat(buildTargetFinder.findTargetForFile(new File("/root/j/c/g/some/dir/File.java"))).isEqualTo(TargetExpression.fromStringSafe("//j/c/g/some:all"));
}
use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.
the class BuildFileTypeTest method testSkylarkExtensionRecognized.
@Test
public void testSkylarkExtensionRecognized() {
PsiFile file = workspace.createPsiFile(new WorkspacePath("java/com/google/foo/build_defs.bzl"));
assertThat(file).isInstanceOf(BuildFile.class);
}
use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.
the class BuildFileTypeTest method testExactNameMatch.
@Test
public void testExactNameMatch() {
PsiFile file = workspace.createPsiFile(new WorkspacePath("java/com/google/foo/BUILD"));
assertThat(file).isInstanceOf(BuildFile.class);
}
Aggregations