diff options
author | Son Ho | 2022-01-20 00:34:33 +0100 |
---|---|---|
committer | Son Ho | 2022-01-20 00:34:33 +0100 |
commit | 89e353b72826f7466f2f5b72e03ff063bd3e95a0 (patch) | |
tree | 7b2d8fb0f9a399d7c06940a5c78909b803d56be2 /src | |
parent | 437cf6d3571f6bdaa7222ea937d019390c6217cf (diff) |
Add a unit test in Cps.ml
Diffstat (limited to '')
-rw-r--r-- | src/Cps.ml | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -89,3 +89,11 @@ let fold_left_apply_continuation (f : 'a -> ('b -> 'c -> 'd) -> 'c -> 'd) comp (f x) (fun cf v -> eval_list inputs cf (v :: outputs)) cf ctx in eval_list inputs cf [] + +(** Unit test/example for [fold_left_apply_continuation] *) +let _ = + fold_left_apply_continuation + (fun x cf () -> cf (10 + x) ()) + [ 0; 1; 2; 3; 4 ] + (fun values () -> assert (values = [ 10; 11; 12; 13; 14 ])) + () |