Skip to content

Commit

Permalink
Add missing PostifxedFileName tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarX committed Oct 3, 2024
1 parent 46a93b0 commit a2a5e2f
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ class PostifxedFileNameUnitTest {
assertAlreadyExistingFileName(inputFileName = "file.abc.def.ghi", expectedFileName = "file.abc.def(1).ghi")
}

@Test
fun unusedDotEndingFileName_isUnchanged() {
assertNewFileNameIsUnchanged(inputFileName = "file.")
}

@Test
fun usedDotEndingFileName_isPostfixed() {
assertAlreadyExistingFileName(inputFileName = "file.", expectedFileName = "file(1).")
}

private fun assertAlreadyExistingFileName(inputFileName: String, expectedFileName: String) {
val newName = postfixExistingFileNames(inputFileName, setOf(inputFileName))
assertEquals(newName, expectedFileName)
Expand Down

0 comments on commit a2a5e2f

Please sign in to comment.