repeat
Translation status: English reader-locale proof. Term names and code fences follow the en pack; supporting prose may still be English.
Runs a test N times and passes only if every run passes.
Syntax: repeat <number>
Category#
testing
Related#
Examples#
radix/corpus/reference/keyword/repete/repete.fab (canonical · keyword)#
Runs a test N times and passes only if every run passes.
# =============================================================================
# repeat — Runs a test N times; every run must pass.
# =============================================================================
#
# What this teaches:
# • `repeat <N>` runs the test case N times and passes only if every run
# passes; it does not retry until one run passes.
# • Declared as a test modifier on `test`
#
# Common mistakes:
# • Treating `repeat` as retry-until-pass — all N runs must pass.
# • Confusing `repeat` (test repetition modifier) with `for` (loop iterator) or `do`/`while` (loop constructs).
#
# See also: flaky
# =============================================================================
# repeat — repeat test modifier
#
# GRAMMAR:
# testModifier :← 'repeat' integer
#
# EXPECTED RUNNER OUTCOME:
# `faber test corpus/repete/repete.fab` runs the passing case twice; it passes
# only when both executions pass.
#
# BACKEND:
# declaration-only test modifier (whitelist: repeat/repete.fab).
#
test "two passing runs" repeat 2 {
assert true
}