คาดหวัง_ล้มเหลว
Translation status: ภาษาไทย reader-locale proof. Term names and code fences follow the th-TH pack; supporting prose may still be English.
Marks a test as expected to fail.
Aliases: expect failure
Syntax: ทดสอบ <name> คาดหวัง_ล้มเหลว <block>
Category#
testing
Related#
Examples#
radix/corpus/erratur/erratur.fab (canonical · keyword)#
Marks a test as expected to fail.
# =============================================================================
# คาดหวัง_ล้มเหลว — Marks a test as expected to fail
# =============================================================================
#
# What this teaches:
# • Expected failure — `คาดหวัง_ล้มเหลว` records a test whose failing assertion is a known defect, with no argument.
# • Modifier position — it sits between the test name and the body, like `ละเว้น` and `เปราะบาง`.
#
# Common mistakes:
# • Confusing คาดหวัง_ล้มเหลว (expected failure) with ละเว้น (skipped) — an คาดหวัง_ล้มเหลว test still runs.
#
# See also: ทดสอบ, เปราะบาง, ละเว้น
# =============================================================================
# คาดหวัง_ล้มเหลว — expected-failure test modifier
#
# GRAMMAR:
# testModifier :← 'คาดหวัง_ล้มเหลว'
#
# EXPECTED OUTPUT:
# คาดหวัง_ล้มเหลว declared
test "known defect" expect_failure {
assert 1 + 1 ≡ 3
}
main {
print "erratur declared"
}Expected output:
erratur declared