Skip to content

Commit

Permalink
Added test: Replace an existing, shortened, empty directory
Browse files Browse the repository at this point in the history
  • Loading branch information
JaniruTEC committed Aug 8, 2023
1 parent 6901c32 commit ef94c1e
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,23 @@ public void testReplaceExistingShortenedFile() throws IOException {
}
}

/* //TODO https://github.com/cryptomator/cryptofs/issues/176
@Test
@DisplayName("Replace an existing, shortened, empty directory")
public void testReplaceExistingShortenedDirEmpty() throws IOException {
try (var fs = setupCryptoFs(50, 100, false)) {
var dirName50Chars = "/target_89_123456789_123456789_123456789_123456789_"; //since filename encryption increases filename length, 50 cleartext chars are sufficient
var source = fs.getPath("/sourceDir");
var target = fs.getPath(dirName50Chars);
Files.createDirectory(source);
Files.createDirectory(target);
assertDoesNotThrow(() -> Files.move(source, target, REPLACE_EXISTING));
assertTrue(Files.notExists(source));
assertTrue(Files.exists(target));
}
}*/

private FileSystem setupCryptoFs(int ciphertextShorteningThreshold, int maxCleartextFilename, boolean readonly) throws IOException {
byte[] key = new byte[64];
Arrays.fill(key, (byte) 0x55);
Expand Down

0 comments on commit ef94c1e

Please sign in to comment.