error test-decl
What it means#
The form of a test is attributes* test kind? "name" (params)? (with env, …)? (seeds range)? { body } (§18.1, D-7060). The
compiler (in oxl test builds) reports this diagnostic when
- a test other than
test fuzzhas parameters — only a fuzz test's parameters are generated (D-7060); - a fuzz parameter has a default value or is variadic / lazy (it must be
name: Type); with schema(old: …)is used outside atest contract, or itsold:is not a string (a version such as0.3.0,published, or a path to anoxl.schema.lock, D-7070).
A fuzz parameter type must also be serializable (Serializable, §9.1): the generator follows the serialization schema of the
type; other types are rejected by the ordinary bound check of oxlFuzzArg<T: Serializable>.
Example#
test "sum" (x: i64) { assert x + 0 == x } // <- test-decl: write `test fuzz "sum" (x: i64)`
test "compat" with schema(old: "v1.lock") { } // <- test-decl: `schema(…)` is for `test contract`error
test-decl
How to fix#
test fuzz "sum" (x: i64) { assert x + 0 == x }
test contract "compat" with schema(old: "v1.lock") as old {
assert old.roundtrip(&Order{ id: 1 }).id == 1
}