aboutsummaryrefslogtreecommitdiff
path: root/core/tests/from_to.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/tests/from_to.c')
-rw-r--r--core/tests/from_to.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/tests/from_to.c b/core/tests/from_to.c
new file mode 100644
index 0000000..d6a392d
--- /dev/null
+++ b/core/tests/from_to.c
@@ -0,0 +1,10 @@
+#include <tri.h>
+
+int main()
+{
+ /* increment by prime to hopefully somewhat randomly test patterns */
+ for (int64_t i = TRI_MIN; i < TRI_MAX; i += 1048009) {
+ tri_t t = tri_from(i);
+ assert(tri_to(t) == i);
+ }
+}