Skip to content

Commit 139f641

Browse files
committed
add test
1 parent 7790221 commit 139f641

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/test/java/org/cryptomator/cryptofs/CryptoFileSystemProviderInMemoryIntegrationTest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,21 @@ public static void afterAll() throws IOException {
5858
tmpFs.close();
5959
}
6060

61+
@Test
62+
@DisplayName("Replace an existing, shortened, empty directory")
63+
public void testReplaceExistingShortenedDirEmpty() throws IOException {
64+
try (var fs = setupCryptoFs(50, 100, false)) {
65+
var dirName50Chars = "/target_89_123456789_123456789_123456789_123456789_"; //since filename encryption increases filename length, 50 cleartext chars are sufficient
66+
var source = fs.getPath("/sourceDir");
67+
var target = fs.getPath(dirName50Chars);
68+
Files.createDirectory(source);
69+
Files.createDirectory(target);
70+
assertDoesNotThrow(() -> Files.move(source, target, REPLACE_EXISTING));
71+
assertTrue(Files.notExists(source));
72+
assertTrue(Files.exists(target));
73+
}
74+
}
75+
6176
@Test
6277
@DisplayName("Replace an existing, shortened file")
6378
public void testReplaceExistingShortenedFile() throws IOException {

0 commit comments

Comments
 (0)