soma.cell

What a test cell's rules { } accepts

Pitfall 17 of writing Soma, the programming language: a habit from another language, or a rule that surprises, with what the Soma compiler answers and the form to write.

assert, assert_fails (optionally … matching "text"), let name = expr (a fixture for the rules below), mock think "reply" / mock think ["a", "b"] / mock think error "timeout", mock http_get map(...) / mock Cell.handler v, and property. No bare statements: put logic in a handler and call it. A List given to any mock is a QUEUE — one reply per call, in order — so a handler or http_get that answers a JSON array is mocked with a nested list:

mock http_get [1, 2]       // two calls: the first gets 1, the second 2
mock http_get [[1, 2]]     // one call gets the list [1, 2]

soma test notes a scripted reply that no call consumed.