Skip to content

Commit

Permalink
Test case for sorting hidden files/folders - see #3280
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyScherzinger committed Nov 21, 2018
1 parent 90e74a6 commit e7d78a7
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/test/java/com/owncloud/android/utils/TestSorting.java
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,34 @@ public void testSortCloudFilesWithDots() {
assertTrue(sortAndTest(array));
}

@Test
public void testDotFilesAndFolders() {
List<OCFile> array = new ArrayList<>();

array.add(new OCFile("/.apache2").setFolder());
array.add(new OCFile("/.cache").setFolder());
array.add(new OCFile("/.config").setFolder());
array.add(new OCFile("/.local").setFolder());
array.add(new OCFile("/.logs").setFolder());
array.add(new OCFile("/.nano").setFolder());
array.add(new OCFile("/.nginx").setFolder());
array.add(new OCFile("/.script-credentials").setFolder());
array.add(new OCFile("/.ssh").setFolder());
array.add(new OCFile("/.subversion").setFolder());
array.add(new OCFile("/.znc").setFolder());
array.add(new OCFile("/.bash_aliases"));
array.add(new OCFile("/.bash_history"));
array.add(new OCFile("/.bash_logout"));
array.add(new OCFile("/.bashrc"));
array.add(new OCFile("/.feral_aliases"));
array.add(new OCFile("/.mysql_history"));
array.add(new OCFile("/.profile"));
array.add(new OCFile("/.selected_editor"));
array.add(new OCFile("/.wget-hsts"));

assertTrue(sortAndTest(array));
}

private List<Comparable> shuffle(List<? extends Comparable> files) {
List<Comparable> shuffled = new ArrayList<>();
shuffled.addAll(files);
Expand Down

0 comments on commit e7d78a7

Please sign in to comment.