OxL Reference

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✓ checked in 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)

Since. 1.0.0-beta

Parameters

NameType
indexi64
valueT

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/testing.oxl:321

See also