File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
opengrok-indexer/src/test/java/org/opengrok/indexer/util Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 25
25
26
26
import java .io .File ;
27
27
import java .io .IOException ;
28
+ import java .net .URI ;
28
29
import java .nio .file .Files ;
29
30
import java .nio .file .Path ;
30
31
import java .nio .file .Paths ;
@@ -63,16 +64,16 @@ public void tearDown() {
63
64
64
65
@ Test
65
66
public void shouldHandleSameInputs () throws IOException {
66
- final String USR_BIN = "/ usr/bin" ;
67
+ final String USR_BIN = Paths . get ( URI . create ( "file:/// usr/bin")). toString () ;
67
68
String rel = PathUtils .getRelativeToCanonical (USR_BIN , USR_BIN );
68
- Assert .assertEquals ("/usr/bin rel to itself" , "" , rel );
69
+ Assert .assertEquals (USR_BIN + " rel to itself" , "" , rel );
69
70
}
70
71
71
72
@ Test
72
73
public void shouldHandleEffectivelySameInputs () throws IOException {
73
- final String USR_BIN = "/ usr/bin" ;
74
- String rel = PathUtils .getRelativeToCanonical (USR_BIN + "/" , USR_BIN );
75
- Assert .assertEquals ("/usr/bin rel to ~itself" , "" , rel );
74
+ final String USR_BIN = Paths . get ( URI . create ( "file:/// usr/bin")). toString () ;
75
+ String rel = PathUtils .getRelativeToCanonical (USR_BIN + File . separator , USR_BIN );
76
+ Assert .assertEquals (USR_BIN + " rel to ~itself" , "" , rel );
76
77
}
77
78
78
79
@ Test
You can’t perform that action at this time.
0 commit comments