Packages

builtin
cbindgen
core
core.alloc
core.alloc.arena
core.alloc.atomic
core.alloc.fixed
core.alloc.gc
core.alloc.heap
core.alloc.log
core.alloc.memdebug
core.alloc.pool
core.alloc.ring
core.arg_parse
core.array
core.avl_tree
core.bucket_array
core.conv
core.doc
core.encoding
core.encoding.base64
core.encoding.csv
core.encoding.hex
core.encoding.json
core.encoding.kdl
core.encoding.osad
core.encoding.utf8
core.hash
core.hash.md5
core.hash.sha1
core.hash.sha256
core.heap
core.intrinsics
core.intrinsics.atomics
core.intrinsics.onyx
core.intrinsics.types
core.intrinsics.wasm
core.io
core.io.binary
core.iter
core.js
core.list
core.map
core.math
core.memory
core.misc
core.net
core.os
core.random
core.set
core.slice
core.string
core.sync
core.test
core.thread
core.time
main
runtime
runtime.info
runtime.platform
runtime.vars
simd

package core.test

T
T :: struct {
    current_test_case: &Test_Case;
}

Testing context

Methods
T.assert
T.assert :: (t: &T, cond: bool, name: [] u8, site: CallSite) -> void
Test_Case
Test_Case :: struct {
    name: [] u8;
    runner: (&T) -> void;
    passed: bool;
    assertions: [..] Test_Case.Assertion;
}
test
test :: struct {
    name: [] u8;
}

Test tag. Use this to mark a function as a test.

You can either use just the type name:

@core.test.test
(t: &core.test.T) {
}

Or you can specify a name using the full struct literal:

@core.test.test.{"Important test name"}
(t: &core.test.T) {
}
gather_test_cases
gather_test_cases :: (packages: [] package_id) -> [] Test_Case
run_tests
run_tests :: (packages: [] package_id, log: bool) -> bool

Runs all test cases in the provide packages. If no packages are provided, ALL package tests are run.