渲染zh-Hant

測試

Translation status: 繁體中文 reader-locale proof. Term names and code fences follow the zh-Hant pack; supporting prose may still be English.

Defines a single test case.

Aliases: test, it

Syntax: 測試 <name> [modifiers] <block>

Category#

testing

Examples#

radix/corpus/proba/proba.fab (canonical · keyword)#

Defines a single test case.

# =============================================================================
# 測試 — Defines a single test case.
# =============================================================================
#
# What this teaches:
#   • Individual test cases — `測試` declares one test with a descriptive name
#     and optional modifiers
#   • Tests live inside `測試規格` suites and contain `斷言` assertions
#
# Common mistakes:
#   • Using `斷言` outside a `測試`/`測試規格` test block — `斷言` is deprecated in production code (WARN006).
#
# See also: 測試規格, 斷言, 略過, 預期
# =============================================================================

# 測試 — single test case
#
# GRAMMAR:
#   testDecl :← '測試' stringLit block
#
# EXPECTED OUTPUT:
#   No 入口 — declaration or test-runner surface only.
#
# BACKEND:
#   declaration-only test case (whitelist: 測試/proba.fab). Cross-ref: 測試規格/probandum.fab.
#

test "arithmetic passes" 標籤 "math" {
    assert 1 + 1 ≡ 2
}