渲染zh-Hant

後置準備非同步

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

Registers an async after-each test hook.

Syntax: 後置準備非同步 <block>

Category#

testing

Examples#

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

Registers an async after-each test hook.

# =============================================================================
# 後置準備非同步 — Registers an async after-each test hook.
# =============================================================================
#
# What this teaches:
#   • Async test hooks — `後置準備非同步` registers an async cleanup hook that runs after each test case.
#   • Async counterpart — Pairs with `準備非同步` (async before-each) and mirrors `後置準備` (sync after-each).
#
# Common mistakes:
#   • Confusing `後置準備非同步` (async teardown) with `準備非同步` (async setup) — they run at opposite ends of each test.
#
# See also: 後置準備, 準備非同步
# =============================================================================

# 後置準備非同步 — async after-each hook
#
# GRAMMAR:
#   hookDecl :← '後置準備非同步' block
#
# EXPECTED OUTPUT:
#   No 入口 — declaration or test-runner surface only.
#
# BACKEND:
#   declaration-only test hook (whitelist: 後置準備非同步/postparabit.fab).
#

describe "async hooks" {
    async_teardown {
        print "after each async"
    }
    test "sample" {
        assert true
    }
}