hd-lang

Tour · 18 of 25

Tests sit next to the code they check, with nothing to install

A file keeps its tests in a tests: block. Each it("name"): is one test case, and it may call the file's private functions, so you test the real helper, not a copy made public for the test. it_each runs one case per row of a table. The assertions come from std.testing, and hd test runs the cases, so there is no test framework to pick or configure. Test code is compiled only for testing, so none of it ships in the program.

Test: Ctrl+Enter · Pages: Alt+← Alt+→