From 2b5a8a428cbbdda8ef0efa7b2c77c100b8dbfa0c Mon Sep 17 00:00:00 2001 From: hachem Date: Sun, 30 Aug 2026 04:30:33 +0200 Subject: test: add lexer testing --- tests/test.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/test.h (limited to 'tests/test.h') diff --git a/tests/test.h b/tests/test.h new file mode 100644 index 0000000..c5e2e73 --- /dev/null +++ b/tests/test.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +struct TestContext +{ + int checks; + int failures; +}; + +#define check(context, condition) \ + do \ + { \ + (context)->checks += 1; \ + if (!(condition)) \ + { \ + (context)->failures += 1; \ + printf(" FAIL %s:%d: %s\n", __FILE__, __LINE__, #condition); \ + } \ + } \ + while (0) -- cgit v1.3