Initial Dever 0.0.1

This commit is contained in:
Codex committed 2026-11-03 03:32:07 +00:00
commit 81233d098c
1479 files changed
+163782

No files matched your search

+66
View File
@@ -0,0 +1,66 @@
type Problem { error Text(message: Text)
error Number(value: Int) }
type LocalResult { Done
error Failed(values: List<Stream<Int>>) }
work(delay: Int) () { dever.task.sleep(delay) }
cpu() () pure {}
duration() (value: Int) { dever.task.sleep(0)
value = 0 }
badText(delay: Int) () { dever.task.sleep(delay)
fail(Problem.Text("worker")) }
badNumber() () { fail(Problem.Number(42)) }
badDuration() (value: Int) { dever.task.sleep(0)
fail(Problem.Text("argument")) }
failedGroup() () { pool = group(2)
run(pool, work(60000))
run(pool, badText(0))
wait(pool) }
failedAdmission() () { pool = group(1)
run(pool, badNumber())
run(pool, work(60000))
wait(pool) }
failedArgument() () { pool = group(2)
run(pool, work(60000))
run(pool, work(badDuration())) }
invalidGroup() () { pool = group(0)
wait(pool) }
emptyGroups() () { wait(group(2))
stop(group(1)) }
localParent(flag: true) () {
pool = group(1)
run(pool, cpu())
wait(pool)
}
localParent(flag: false) () { fail(LocalResult.Failed([])) }
localHandled(value: LocalResult.Done) (answer: Bool) recover("观察局部错误") { answer = false }
localHandled(value: LocalResult.Failed(values)) (answer: Bool) recover("观察局部错误") { answer = length(values) == 0 }
verifyLocal() (answer: Bool) { localParent(true)
answer = localHandled(result(localParent(false))) }
verify() (answer: Bool) {
emptyGroups()
pool = group(2)
run(pool, cpu())
run(pool, work(0))
run(pool, work(duration()))
wait(pool)
pool = group(1)
run(pool, work(60000))
stop(pool)
answer = true
}