From d96b8c7d12fc61ec609d6138627b9d6d18139a9a Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sat, 28 Oct 2023 00:00:21 +0300 Subject: move to monorepo + Will probably have to make some changes to dir layout to make things make more sense --- core/tests/unop.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 core/tests/unop.c (limited to 'core/tests/unop.c') diff --git a/core/tests/unop.c b/core/tests/unop.c new file mode 100644 index 0000000..a63e420 --- /dev/null +++ b/core/tests/unop.c @@ -0,0 +1,24 @@ +#include + +int main() +{ + /* technically speaking there are only 27 cases to test, and they could + * potentially all checked for manually, but this is good enough for now + */ + tri_t t = tri_parse_default("i01", 3); + + tri_t r = tri_unop(NOP, t); + assert(tri_eq(r, t)); + + r = tri_unop(NNN, t); + assert(tri_eq(r, tri_from(TRI_MIN))); + + r = tri_unop(OOO, t); + assert(tri_eq(r, tri_from(0))); + + r = tri_unop(PPP, t); + assert(tri_eq(r, tri_from(TRI_MAX))); + + r = tri_unop(PON, t); + assert(tri_eq(r, tri_parse_default("10i", 3))); +} -- cgit v1.3