Expand description
htl test: discovery, one isolated Lua state per test file, compile, report.
The runner owns nothing about assertions. A test file requires a library; the
bundled default is htl.test (describe / it / expect, typed via test.d.tl).
Any library exposing run(filter) -> { passed, failed, failures } under the
module name the runner is told about plugs in the same way. A file that uses no
such library is judged at file level: it passes if it runs to completion.
Structs§
- File
Report - Outcome of one test file.
- RunOptions
- Runner options passed through to the library’s
run(filter, opts). - Test
Result - One test’s outcome, as reported by the assertion library.
- Test
Session - One checker for a whole run: every test file gets its own fresh program state
(globals,
package.loaded, module state), but modules are type-checked and generated once and served to every file from the checker’s store.
Constants§
- DEFAULT_
LIB - Module name of the bundled assertion library.
Functions§
- discover_
tests *_test.tlanywhere, plus every.tlunder a directory namedtests. Explicit file paths are always included. Does not entercrate::SKIP_DIRS, dot-directories or the project’s mlua-pkg dir (dependencies’ tests are theirs).- discover_
tests_ skipping discover_tests, not enteringskipeither — directories named by path rather than by name (crate::patched_dirs: a patched dependency’s*_test.tlare its own suite, not the project’s).- file_
seed - The seed one file gets, from the run’s seed and its path.
- lib_dir
crate::lib_dirwith this library’s declaration in it:htl/test.d.tl, written on demand, only when its content changes.- run_
test_ file - Run one test file in a fresh state.
libis the assertion library module to consult forrun(filter)after the file executed (default:htl.test). - snapshot_
dir - Where a test file’s snapshots live:
<dir>/__snapshots__/<file stem>/.