Skip to content

Commit cd0a957

Browse files
committed
remove unixPath changes
1 parent 1e585fc commit cd0a957

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

src/main/java/com/crowdin/cli/utils/Utils.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,7 @@ public static String buildUserAgent() {
8787
}
8888

8989
public static String unixPath(String path) {
90-
if (path == null) {
91-
return null;
92-
}
93-
return isWindows()
94-
? path.replaceAll("[\\\\/]+", "/")
95-
: path.replaceAll("\\\\{2,}", "/").replaceAll("/+", "/");
90+
return (path != null) ? path.replaceAll("\\{2,}", "/").replaceAll("/+", "/") : null;
9691
}
9792

9893
public static String windowsPath(String path) {

src/test/java/com/crowdin/cli/utils/UtilsTest.java

+2-11
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import java.util.Optional;
44
import org.apache.commons.lang3.SystemUtils;
55
import org.junit.jupiter.api.Test;
6-
import org.junit.jupiter.api.condition.DisabledOnOs;
7-
import org.junit.jupiter.api.condition.OS;
86

97
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
108
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -38,15 +36,8 @@ public void testBuildUserAgent() {
3836
}
3937

4038
@Test
41-
@DisabledOnOs({OS.LINUX, OS.MAC})
42-
public void testUnixPath_windows() {
43-
assertEquals("/path/to/file", Utils.unixPath("\\path\\to\\\\file"));
44-
}
45-
46-
@Test
47-
@DisabledOnOs(OS.WINDOWS)
48-
public void testUnixPath_unix() {
49-
assertEquals("/path/to/file", Utils.unixPath("/path/to\\\\file"));
39+
public void testUnixPath() {
40+
assertEquals("/path/to/file", Utils.unixPath("\\path\\to\\file"));
5041
}
5142

5243
@Test

0 commit comments

Comments
 (0)