Skip to content

Commit ef94c1e

Browse files
committed
Added test: Replace an existing, shortened, empty directory
1 parent 6901c32 commit ef94c1e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,23 @@ public void testReplaceExistingShortenedFile() throws IOException {
7474
}
7575
}
7676

77+
/* //TODO https://github.com/cryptomator/cryptofs/issues/176
78+
@Test
79+
@DisplayName("Replace an existing, shortened, empty directory")
80+
public void testReplaceExistingShortenedDirEmpty() throws IOException {
81+
try (var fs = setupCryptoFs(50, 100, false)) {
82+
var dirName50Chars = "/target_89_123456789_123456789_123456789_123456789_"; //since filename encryption increases filename length, 50 cleartext chars are sufficient
83+
var source = fs.getPath("/sourceDir");
84+
var target = fs.getPath(dirName50Chars);
85+
Files.createDirectory(source);
86+
Files.createDirectory(target);
87+
88+
assertDoesNotThrow(() -> Files.move(source, target, REPLACE_EXISTING));
89+
assertTrue(Files.notExists(source));
90+
assertTrue(Files.exists(target));
91+
}
92+
}*/
93+
7794
private FileSystem setupCryptoFs(int ciphertextShorteningThreshold, int maxCleartextFilename, boolean readonly) throws IOException {
7895
byte[] key = new byte[64];
7996
Arrays.fill(key, (byte) 0x55);

0 commit comments

Comments
 (0)