void () { assumeWindows(); String[] fsRoots = StreamSupport.stream(FileSystems.getDefault().getRootDirectories().spliterator(), false).map(Path::toString).toArray(String[]::new); String[] wslRoots = wslRule.getVms().stream().map(d -> StringUtil.trimTrailing(d.getUNCRootPath().toString(), '\\')).toArray(String[]::new); String[] allRoots = ArrayUtil.mergeArrays(fsRoots, wslRoots, String[]::new); String firstRoot = Stream.of(allRoots).sorted().findFirst().orElseThrow(); assertComplete("", allRoots, Map.of(), "", firstRoot); String sysDrive = System.getenv("SystemDrive"); assertThat(sysDrive).isNotBlank(); String[] expected = {sysDrive + '\\'}; assertComplete(sysDrive.substring(0, 1), expected, Map.of(), "", expected[0]); assertComplete(sysDrive, expected, Map.of(), "", expected[0]); if (wslRoots.length != 0) { String firstWsl = Stream.of(wslRoots).sorted().findFirst().orElseThrow(); int p = firstWsl.indexOf('\\', 2); assertThat(p).withFailMessage("Malformed name: '%s'", firstWsl).isGreaterThan(2); assertComplete("\\\\", wslRoots, Map.of(), "", firstWsl); assertComplete(firstWsl.substring(0, 3), wslRoots, Map.of(), "", firstWsl); // '\\w' assertComplete(firstWsl.substring(0, p + 1), wslRoots, Map.of(), "", firstWsl); // '\\wsl$\' assertComplete(firstWsl, new String[]{firstWsl}, Map.of(), "", firstWsl); // '\\wsl$\xxx' assertComplete(firstWsl + "\\ho", new String[]{"home"}, Map.of(), "", "home"); // '\\wsl$\xxx\ho' } }