def budget
import ezx@1.11.0.0/src/ez/test.bend as Testimport Base
106# the budget checked the way every other thing here is checked. A run that
107# overran is a run that failed, and it says so in the count rather than merely
108# taking a long time.
109def budget(late: Bool, +secs: String, score: Tally) -> IO(Tally):
110 match late:
111 case False{}:
112 IO.pure(Tally, score)
113 case True{}:
114 do IO<Tally>:
115 IO.write("FAIL: the gate took longer than its " ++ secs ++ " second " ++
116 "budget\n set EZ_DEADLINE higher if this tree honestly needs " ++
117 "longer, or to 0 to stop asking\n")
118 return tally(False{}, score)