use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.
the class ImportRootsTest method testOverlappingDirectoriesAreFilteredOut.
@Test
public void testOverlappingDirectoriesAreFilteredOut() {
ImportRoots importRoots = ImportRoots.builder(workspaceRoot, BuildSystem.Blaze).add(new DirectoryEntry(new WorkspacePath("root"), true)).add(new DirectoryEntry(new WorkspacePath("root"), true)).add(new DirectoryEntry(new WorkspacePath("root/subdir"), true)).build();
assertThat(importRoots.rootDirectories()).containsExactly(new WorkspacePath("root"));
}
use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.
the class ImportRootsTest method testContainsWorkspacePath_samePath.
@Test
public void testContainsWorkspacePath_samePath() throws Exception {
ImportRoots importRoots = ImportRoots.builder(workspaceRoot, BuildSystem.Blaze).add(DirectoryEntry.include(new WorkspacePath("root"))).build();
assertThat(importRoots.containsWorkspacePath(new WorkspacePath("root"))).isTrue();
}
use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.
the class ImportRootsTest method testWorkspaceRootIsOnlyDirectoryLeft.
@Test
public void testWorkspaceRootIsOnlyDirectoryLeft() {
ImportRoots importRoots = ImportRoots.builder(workspaceRoot, BuildSystem.Blaze).add(new DirectoryEntry(new WorkspacePath("."), true)).add(new DirectoryEntry(new WorkspacePath("."), true)).add(new DirectoryEntry(new WorkspacePath("root/subdir"), true)).build();
assertThat(importRoots.rootDirectories()).containsExactly(new WorkspacePath("."));
}
use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.
the class ImportRootsTest method testOverlappingExcludesAreFiltered.
@Test
public void testOverlappingExcludesAreFiltered() {
ImportRoots importRoots = ImportRoots.builder(workspaceRoot, BuildSystem.Blaze).add(new DirectoryEntry(new WorkspacePath("root"), false)).add(new DirectoryEntry(new WorkspacePath("root"), false)).add(new DirectoryEntry(new WorkspacePath("root/subdir"), false)).build();
assertThat(importRoots.excludeDirectories()).containsExactly(new WorkspacePath("root"));
}
use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.
the class ImportRootsTest method testBazelArtifactDirectoriesExcluded.
@Test
public void testBazelArtifactDirectoriesExcluded() {
ImportRoots importRoots = ImportRoots.builder(workspaceRoot, BuildSystem.Bazel).add(new DirectoryEntry(new WorkspacePath(""), true)).build();
ImmutableList<String> artifactDirs = BuildSystemProvider.getBuildSystemProvider(BuildSystem.Bazel).buildArtifactDirectories(workspaceRoot);
assertThat(importRoots.rootDirectories()).containsExactly(new WorkspacePath(""));
assertThat(importRoots.excludeDirectories().stream().map(WorkspacePath::relativePath).collect(Collectors.toList())).containsExactlyElementsIn(artifactDirs);
assertThat(artifactDirs).contains("bazel-" + workspaceRoot.directory().getName());
}
Aggregations