void () { assertThat(OSAgnosticPathUtil.getParent("")).isNull(); assertThat(OSAgnosticPathUtil.getParent("\\")).isNull(); assertThat(OSAgnosticPathUtil.getParent("tmp\\a")).isEqualTo("tmp"); assertThat(OSAgnosticPathUtil.getParent("tmp/a/")).isEqualTo("tmp"); assertThat(OSAgnosticPathUtil.getParent("tmp")).isNull(); assertThat(OSAgnosticPathUtil.getParent("/tmp/a")).isEqualTo("/tmp"); assertThat(OSAgnosticPathUtil.getParent("/tmp/a/")).isEqualTo("/tmp"); assertThat(OSAgnosticPathUtil.getParent("/tmp")).isEqualTo("/"); assertThat(OSAgnosticPathUtil.getParent("/")).isNull(); assertThat(OSAgnosticPathUtil.getParent("/tmp/a/.")).isEqualTo("/tmp/a"); assertThat(OSAgnosticPathUtil.getParent("/tmp/a/../b")).isEqualTo("/tmp/a/.."); assertThat(OSAgnosticPathUtil.getParent("c:/tmp/a")).isEqualTo("c:/tmp"); assertThat(OSAgnosticPathUtil.getParent("c:\\tmp\\a\\")).isEqualTo("c:\\tmp"); assertThat(OSAgnosticPathUtil.getParent("c:/tmp\\a")).isEqualTo("c:/tmp"); assertThat(OSAgnosticPathUtil.getParent("c:\\tmp/a/")).isEqualTo("c:\\tmp"); assertThat(OSAgnosticPathUtil.getParent("c:/tmp")).isEqualTo("c:/"); assertThat(OSAgnosticPathUtil.getParent("c:\\")).isNull(); assertThat(OSAgnosticPathUtil.getParent("c:")).isNull(); assertThat(OSAgnosticPathUtil.getParent("c:x")).isNull(); if (SystemInfo.isWindows) { assertThat(OSAgnosticPathUtil.getParent("//host/share/a")).isEqualTo("//host/share"); assertThat(OSAgnosticPathUtil.getParent("\\\\host\\share/a/")).isEqualTo("\\\\host\\share"); assertThat(OSAgnosticPathUtil.getParent("//host/share")).isNull(); assertThat(OSAgnosticPathUtil.getParent("\\\\host\\share/")).isNull(); assertThat(OSAgnosticPathUtil.getParent("//host")).isNull(); assertThat(OSAgnosticPathUtil.getParent("\\\\")).isNull(); } }