渲染zh-Hant

postparabit

Translation status: 繁體中文 reader-locale proof. Code fences render through the zh-Hant pipeline; prose is canonical Latin.

Registers an async after-each test hook.

Syntax: postparabit <block>

Category#

testing

Examples#

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

Registers an async after-each test hook.

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

# postparabit — async after-each hook
#
# GRAMMAR:
#   hookDecl :← 'postparabit' block
#
# EXPECTED OUTPUT:
#   No incipit — declaration or test-runner surface only.
#
# BACKEND:
#   declaration-only test hook (whitelist: postparabit/postparabit.fab).
#

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