OxL Reference

kw fixture

Reserved keyword

The list of words: §1.4

Syntax

ebnf
Fixture     = "fixture" Ident "(" [ Params ] ")" "->" Type Block ;

Grammar: App. A

Defined in

  • 18.2 Assertions and fixtures — assert expr is executed in all profiles, including prod (profiles switch off only contracts, §6.7, and the output of dbg, §2.2); on failure
  • 1.4 Keywords — Reserved (cannot be used as names)

Examples

oxl
fixture tempDb() -> Db {
  let d = Db.open("sqlite::memory:")
  yield d                    // the test runs here
  d.close()
}

test "insert" with tempDb as db { db.insert(order) }

— 18.2 Assertions and fixtures

Related diagnostics

fixture-yield

See also