From eb0ed93d0e58027a8011722ffc88cd3378f62a52 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Mon, 29 Jan 2024 18:47:50 -0800 Subject: [PATCH] Add example tests for non-CPS --- test-lib.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test-lib.c b/test-lib.c index 1714e33a..e9edd92a 100644 --- a/test-lib.c +++ b/test-lib.c @@ -29,10 +29,23 @@ int main(int argc, char **argv, char **envp) return 0;} */ +void test_exact() { + common_type ptr; + make_double(d, 42.5); + assert(obj_int2obj(42) == Cyc_exact_no_cps(NULL, &ptr, obj_int2obj(42))); + object result = Cyc_exact_no_cps(NULL, &ptr, &d); + assert( result == obj_int2obj(43)); + + // TODO: unit tests for below as examples: + //void Cyc_exact(void *data, object cont, object z) +} + int main(){ assert(boolean_t == boolean_t); assert(boolean_t != boolean_f); + test_exact(); + printf("All tests passed successfully!\n"); return 0; }