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

fn oxlProvideSet

provide T = value in a test (§18.2, D-6107): replaces the value of the provide number index of the program until the test ends.

Example:

oxl✓ проверяется в CI
provide Duration = 30s

fn timeout() -> Duration => 30s

test "a provided value is replaced in a test" {
  provide Duration = 1s
  assert_eq(timeout(), 30s)
}
@intrinsic("test.provideSet") pub(api) fn oxlProvideSet<T>(index: i64, value: T)

С версии. 1.0.0-beta

Параметры

ИмяТип
indexi64
valueT

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/core/testing.oxl:321

См. также