Skip to content

Commit 26a9138

Browse files
committed
Added test: Replace an existing, shortened, empty directory
1 parent 2ab5f10 commit 26a9138

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,23 @@ public void testReplaceExistingShortenedFile() throws IOException {
630630
}
631631
}
632632

633+
/* //TODO https://github.com/cryptomator/cryptofs/issues/176
634+
@Test
635+
@DisplayName("Replace an existing, shortened, empty directory")
636+
public void testReplaceExistingShortenedDirEmpty() throws IOException {
637+
try (var fs = setupCryptoFs(50, 100, false)) {
638+
var dirName50Chars = "/target_89_123456789_123456789_123456789_123456789_"; //since filename encryption increases filename length, 50 cleartext chars are sufficient
639+
var source = fs.getPath("/sourceDir");
640+
var target = fs.getPath(dirName50Chars);
641+
Files.createDirectory(source);
642+
Files.createDirectory(target);
643+
644+
Assertions.assertDoesNotThrow(() -> Files.move(source, target, REPLACE_EXISTING));
645+
Assertions.assertTrue(Files.notExists(source));
646+
Assertions.assertTrue(Files.exists(target));
647+
}
648+
}*/
649+
633650
private FileSystem setupCryptoFs(int ciphertextShorteningThreshold, int maxCleartextFilename, boolean readonly) throws IOException {
634651
byte[] key = new byte[64];
635652
Arrays.fill(key, (byte) 0x55);

0 commit comments

Comments
 (0)