mirror of
https://github.com/gedoor/legado.git
synced 2024-09-03 09:55:00 +08:00
优化
This commit is contained in:
parent
cdd2033ce5
commit
100589d215
@ -2,6 +2,7 @@ package io.legado.app
|
|||||||
|
|
||||||
import com.script.SimpleBindings
|
import com.script.SimpleBindings
|
||||||
import io.legado.app.constant.SCRIPT_ENGINE
|
import io.legado.app.constant.SCRIPT_ENGINE
|
||||||
|
import io.legado.app.data.entities.BookChapter
|
||||||
import org.intellij.lang.annotations.Language
|
import org.intellij.lang.annotations.Language
|
||||||
import org.junit.Assert
|
import org.junit.Assert
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
@ -134,4 +135,14 @@ class JsTest {
|
|||||||
Assert.assertEquals(result1, "未知错误,请联系开发者!")
|
Assert.assertEquals(result1, "未知错误,请联系开发者!")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun chapterText() {
|
||||||
|
val chapter = BookChapter(title = "xxxyyy")
|
||||||
|
val bindings = SimpleBindings()
|
||||||
|
bindings["chapter"] = chapter
|
||||||
|
val js = "chapter.title"
|
||||||
|
val result = SCRIPT_ENGINE.eval(js, bindings)
|
||||||
|
Assert.assertEquals(result, "xxxyyy")
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user