mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-14 00:07:36 +02:00
Add example tests for non-CPS
This commit is contained in:
parent
b448438bd6
commit
eb0ed93d0e
1 changed files with 13 additions and 0 deletions
13
test-lib.c
13
test-lib.c
|
@ -29,10 +29,23 @@ int main(int argc, char **argv, char **envp)
|
||||||
return 0;}
|
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(){
|
int main(){
|
||||||
assert(boolean_t == boolean_t);
|
assert(boolean_t == boolean_t);
|
||||||
assert(boolean_t != boolean_f);
|
assert(boolean_t != boolean_f);
|
||||||
|
|
||||||
|
test_exact();
|
||||||
|
|
||||||
printf("All tests passed successfully!\n");
|
printf("All tests passed successfully!\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue