OxL Справочник OxL
РусскийEnglish

error fixture-yield

error Стандарт: [§18.2]

В фикстуре нет `yield`.

What it means#

A fixture (fixture name(params) -> T { … }) sets something up, hands a value to the test with yield value and cleans up afterwards: the statements after the yield run when the test has finished, also when it failed or panicked (§18.2). A fixture body without any yield has nothing to give to test … with name as v.

Example#

oxl✓ проверяется в CI
fixture tempDir() -> str {
  print("setup")                 // <- fixture-yield: no `yield`
  "t"
}

test "uses the fixture" with tempDir as dir {
  assert dir == "t"
}
error
fixture-yield

How to fix#

oxl✓ проверяется в CI
fixture tempDir() -> str {
  print("setup")
  yield "t"                      // the test runs here
  print("cleanup")
}

test "uses the fixture" with tempDir as dir {
  assert dir == "t"
}

See also#

OxL 1.0.0-beta · Версия документации 1.0.0-beta© OxwaldLink · сгенерировано из Стандарта, исходников std и руководства