use of com.google.idea.blaze.base.sync.projectview.ImportRoots in project intellij by bazelbuild.
the class ImportRootsTest method testNoAddedExclusionsWithoutWorkspaceRootInclusion.
@Test
public void testNoAddedExclusionsWithoutWorkspaceRootInclusion() {
ImportRoots importRoots = ImportRoots.builder(workspaceRoot, BuildSystem.Bazel).add(new DirectoryEntry(new WorkspacePath("foo/bar"), true)).build();
assertThat(importRoots.rootDirectories()).containsExactly(new WorkspacePath("foo/bar"));
assertThat(importRoots.excludeDirectories()).isEmpty();
}
use of com.google.idea.blaze.base.sync.projectview.ImportRoots 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.sync.projectview.ImportRoots 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.sync.projectview.ImportRoots 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.sync.projectview.ImportRoots 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"));
}
Aggregations