العرضar

لاحق

Translation status: العربية reader-locale proof. Term names and code fences follow the ar pack; supporting prose may still be English.

Registers an after-each test hook.

Syntax: لاحق <block>

Category#

testing

Examples#

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

Registers an after-each test hook.

# =============================================================================
# لاحق — Registers an after-each test hook.
# =============================================================================
#
# What this teaches:
#   • Test hooks — `لاحق` registers cleanup logic that runs after every test case in a `مختبر` block.
#   • Teardown guarantee — The hook runs regardless of whether the test passes or fails.
#
# Common mistakes:
#   • Confusing `لاحق` (teardown) with `جهز` (setup) — they run at opposite ends of each test.
#
# See also: جهز, الكل
# =============================================================================

# لاحق — after-each test hook
#
# GRAMMAR:
#   hookDecl :← 'لاحق' block
#
# EXPECTED OUTPUT:
#   No بداية — declaration or test-runner surface only.
#
# BACKEND:
#   declaration-only test hook (whitelist: لاحق/postpara.fab).
#

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