33import org .junit .jupiter .api .Assertions ;
44import org .junit .jupiter .api .DisplayName ;
55import org .junit .jupiter .api .Test ;
6+ import org .junit .jupiter .api .condition .DisabledOnOs ;
7+ import org .junit .jupiter .api .condition .EnabledOnOs ;
8+ import org .junit .jupiter .api .condition .OS ;
69
710import java .net .URI ;
811import java .nio .file .Path ;
@@ -11,6 +14,7 @@ public class MountpointTest {
1114
1215 @ Test
1316 @ DisplayName ("MountPoint.forPath()" )
17+ @ DisabledOnOs (OS .WINDOWS )
1418 public void testForPath () {
1519 var path = Path .of ("/foo/bar" );
1620 var mountPoint = Mountpoint .forPath (path );
@@ -23,6 +27,21 @@ public void testForPath() {
2327 }
2428 }
2529
30+ @ Test
31+ @ DisplayName ("MountPoint.forPath() (Windows)" )
32+ @ EnabledOnOs (OS .WINDOWS )
33+ public void testForPathWindows () {
34+ var path = Path .of ("D:\\ foo\\ bar" );
35+ var mountPoint = Mountpoint .forPath (path );
36+
37+ if (mountPoint instanceof Mountpoint .WithPath m ) {
38+ Assertions .assertEquals (path , m .path ());
39+ Assertions .assertEquals (URI .create ("file:///D:/foo/bar" ), mountPoint .uri ());
40+ } else {
41+ Assertions .fail ();
42+ }
43+ }
44+
2645 @ Test
2746 @ DisplayName ("MountPoint.forUri()" )
2847 public void testForUri () {
0 commit comments