diff --git a/src/main/java/com/crowdin/cli/utils/Utils.java b/src/main/java/com/crowdin/cli/utils/Utils.java index e84237b97..293c46373 100755 --- a/src/main/java/com/crowdin/cli/utils/Utils.java +++ b/src/main/java/com/crowdin/cli/utils/Utils.java @@ -87,12 +87,7 @@ public static String buildUserAgent() { } public static String unixPath(String path) { - if (path == null) { - return null; - } - return isWindows() - ? path.replaceAll("[\\\\/]+", "/") - : path.replaceAll("\\\\{2,}", "/").replaceAll("/+", "/"); + return (path != null) ? path.replaceAll("\\{2,}", "/").replaceAll("/+", "/") : null; } public static String windowsPath(String path) { diff --git a/src/test/java/com/crowdin/cli/utils/UtilsTest.java b/src/test/java/com/crowdin/cli/utils/UtilsTest.java index 732a0a59b..c909068d7 100644 --- a/src/test/java/com/crowdin/cli/utils/UtilsTest.java +++ b/src/test/java/com/crowdin/cli/utils/UtilsTest.java @@ -3,8 +3,6 @@ import java.util.Optional; import org.apache.commons.lang3.SystemUtils; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledOnOs; -import org.junit.jupiter.api.condition.OS; import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -38,15 +36,8 @@ public void testBuildUserAgent() { } @Test - @DisabledOnOs({OS.LINUX, OS.MAC}) - public void testUnixPath_windows() { - assertEquals("/path/to/file", Utils.unixPath("\\path\\to\\\\file")); - } - - @Test - @DisabledOnOs(OS.WINDOWS) - public void testUnixPath_unix() { - assertEquals("/path/to/file", Utils.unixPath("/path/to\\\\file")); + public void testUnixPath() { + assertEquals("/path/to/file", Utils.unixPath("\\path\\to\\file")); } @Test