Skip to content

Commit

Permalink
[#522] test dependent platform on fileseparator
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentschoelens authored and mattrpav committed Mar 19, 2024
1 parent 377c9d4 commit 2a338fc
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.junit.Assert;
import org.junit.Test;

import java.io.File;
import java.util.List;

public class IOUtilsTests {
Expand Down Expand Up @@ -65,7 +66,7 @@ public void reorderFilesIncludesNoWildcardWithCommonSuffix() {

@Test
public void reorderFilesIncludesWithWildcardFirst() {
String[] files = {"a.xsd", "common/c1.xsd", "b.xsd", "common/c2.xsd", "common/a.xsd", "common/b.xsd" };
String[] files = {"a.xsd", "common" + File.separatorChar + "c1.xsd", "b.xsd", "common" + File.separatorChar + "c2.xsd", "common" + File.separatorChar + "a.xsd", "common" + File.separatorChar + "b.xsd" };
List<String> orderedFiles = IOUtils.reorderFiles(files, new String[] { "common/*.xsd", "a.xsd", "b.xsd" });

Assert.assertNotNull("Ordered files list should not be null",
Expand All @@ -85,7 +86,7 @@ public void reorderFilesIncludesWithWildcardFirst() {

@Test
public void reorderFilesIncludesWithWildcardMiddle() {
String[] files = {"a.xsd", "common/c1.xsd", "b.xsd", "common/c2.xsd", "common/a.xsd", "common/b.xsd" };
String[] files = {"a.xsd", "common" + File.separatorChar + "c1.xsd", "b.xsd", "common" + File.separatorChar + "c2.xsd", "common" + File.separatorChar + "a.xsd", "common" + File.separatorChar + "b.xsd" };
List<String> orderedFiles = IOUtils.reorderFiles(files, new String[] { "a.xsd", "common/*.xsd", "b.xsd" });

Assert.assertNotNull("Ordered files list should not be null",
Expand All @@ -106,7 +107,7 @@ public void reorderFilesIncludesWithWildcardMiddle() {

@Test
public void reorderFilesIncludesWithWildcardLast() {
String[] files = {"a.xsd", "common/c1.xsd", "b.xsd", "common/c2.xsd", "common/a.xsd", "common/b.xsd" };
String[] files = {"a.xsd", "common" + File.separatorChar + "c1.xsd", "b.xsd", "common" + File.separatorChar + "c2.xsd", "common" + File.separatorChar + "a.xsd", "common" + File.separatorChar + "b.xsd" };
List<String> orderedFiles = IOUtils.reorderFiles(files, new String[] { "a.xsd", "b.xsd", "common/*.xsd" });

Assert.assertNotNull("Ordered files list should not be null",
Expand Down

0 comments on commit 2a338fc

Please sign in to comment.