Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I accumulated a bunch of biggish changes while working on the suspend/read/notify tests. It'd be good to land them, with the as-yet-failing test disabled, to avoid a long-running branch with big changes.
Refactor
Before this PR, the execution model of
moot
is incompatible with flows involvingread()
. Changed things up to fix that; also added docs about the syntax of.moot
files which has grown beyond trivial by now.Extended
.moot
syntax:=exact output
"Normal" assertions in
.moot
files represent MOO values (i.e.Var
s). In practice, this means we run the expected value through an extraeval
to resolve them. This allows nice things like usingplayer
as expected output, and getting the comparison to work as we'd naively expect.Notably, this is the only way we can even do assertions at all when running
Scheduler
-based tests, because fromScheduler
we get aVar
as the result of theeval
call (and not some string-serialized response).This flow becomes suuuper fragile in the presence of
read()
, because the order of messages is hard to reason about (and maybe not even guaranteed). So instead of trying to figure that out, let's introduce a way to say: do not do any kind of extra processing; take the expected value as a string, and compare it to our actual result as a string. This only works on network-based tests.(I guess we could Be Smart, and do the extra resolve step when running with Scheduler and not do it when running via the network, but it feels like being explicit here is the less confusing approach)
Failing
suspend()
+read()
testWeirdly, the
; notify(player, "read: " + read()); return "retval";
case seems to be passing consistently now. Probably #338 made a bigger impact than I initially thought.Starting this with
suspend(0.1)
makes it fail though; that test is currently commented out.