mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2026-01-26 20:51:03 +00:00
fix: handle option types and nulls properly
This commit is contained in:
@@ -85,9 +85,16 @@ internal class PatchOptionsTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `should fail because of the requirement is not met`() {
|
||||
fun `should fail because the requirement is not met`() {
|
||||
assertThrows<RequirementNotMetException> {
|
||||
options.nullify("key1")
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `should fail because getting a non-initialized option is illegal`() {
|
||||
assertThrows<RequirementNotMetException> {
|
||||
println(options["key6"].value)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -196,5 +196,10 @@ class ExampleBytecodePatch : BytecodePatch(listOf(ExampleFingerprint)) {
|
||||
"key5", File("test.txt").toPath(), "title", "description"
|
||||
)
|
||||
)
|
||||
private var key6: String by option(
|
||||
PatchOption.StringOption(
|
||||
"key6", null, "title", "description", true
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user