From c1a98cd65d48693c9cfce5fbc5e5f5a1dbf4c1b7 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Wed, 27 Apr 2022 12:41:05 +0200 Subject: test: set case name from initial filename for a sequence Port more incremental tests. --- test/incremental/assert_function.1.zig | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/incremental/assert_function.1.zig (limited to 'test/incremental/assert_function.1.zig') diff --git a/test/incremental/assert_function.1.zig b/test/incremental/assert_function.1.zig new file mode 100644 index 0000000000..ac2df25d85 --- /dev/null +++ b/test/incremental/assert_function.1.zig @@ -0,0 +1,17 @@ +pub fn main() void { + add(3, 4); +} + +fn add(a: u32, b: u32) void { + const c = a + b; // 7 + const d = a + c; // 10 + const e = d + b; // 14 + assert(e == 14); +} + +pub fn assert(ok: bool) void { + if (!ok) unreachable; // assertion failure +} + +// run +// -- cgit v1.2.3