test: cover file task delivery, replacement, cancellation and provider failures
Verify Tessera GUI / verify (push) Failing after 9m15s

This commit is contained in:
2026-10-23 12:06:44 +08:00
parent 047e008729
commit 05b727a4a5
6 changed files with 225 additions and 31 deletions
+22
View File
@@ -0,0 +1,22 @@
class FileReader {
output: TextBlock
problem: TextBlock
status: TextBlock
task: Object
function apply(self: FileReader): Unit {
self.output.text = self.task.result()
}
function read(self: FileReader, path: String): Unit {
self.task = ui.readText(self, "file", path, self.apply)
self.output.text = ""
self.status.bind("text", self.task.status)
self.problem.bind("text", self.task.error)
}
}
output = TextBlock("尚未读取文件")
problem = TextBlock("")
status = TextBlock("")
reader = FileReader(output, problem, status, ui.state(0))
page = Page()
page.title = "异步文件"
page.render(Column(24,16,TextBlock("在 REPL 调用 reader.read(绝对路径字符串)",2),status,output,problem))