forked from d4rken-org/sdmaid-se
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement SystemCleaner EmptyDirectoryFilter and improve IO logic (pa…
…th matching)
- Loading branch information
Showing
24 changed files
with
484 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
app-common-io/src/test/java/eu/darken/sdmse/common/files/core/APathExtensionTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package eu.darken.sdmse.common.files.core | ||
|
||
import eu.darken.sdmse.common.files.core.local.LocalPath | ||
import eu.darken.sdmse.common.files.core.local.LocalPathLookup | ||
import io.kotest.matchers.shouldBe | ||
import org.junit.jupiter.api.Test | ||
import testhelpers.BaseTest | ||
import java.time.Instant | ||
|
||
class APathExtensionTest : BaseTest() { | ||
|
||
@Test | ||
fun `match operator`() { | ||
val file1: APath = LocalPath.build("test", "file1") | ||
val file2: APath = LocalPath.build("test", "file2") | ||
|
||
val lookup1: APathLookup<*> = LocalPathLookup( | ||
lookedUp = LocalPath.build("test", "file1"), | ||
fileType = FileType.FILE, | ||
size = 16, | ||
modifiedAt = Instant.EPOCH, | ||
ownership = null, | ||
permissions = null, | ||
target = null, | ||
) | ||
val lookup2: APathLookup<*> = LocalPathLookup( | ||
lookedUp = LocalPath.build("test", "file2"), | ||
fileType = FileType.FILE, | ||
size = 16, | ||
modifiedAt = Instant.EPOCH, | ||
ownership = null, | ||
permissions = null, | ||
target = null, | ||
) | ||
file1.matches(file1) shouldBe true | ||
file1.matches(file2) shouldBe false | ||
file1.matches(lookup1) shouldBe true | ||
file1.matches(lookup2) shouldBe false | ||
lookup1.matches(file1) shouldBe true | ||
lookup1.matches(file2) shouldBe false | ||
lookup1.matches(lookup1) shouldBe true | ||
lookup1.matches(lookup2) shouldBe false | ||
file2.matches(lookup2) shouldBe true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.