diff options
author | Son Ho | 2022-05-05 17:05:10 +0200 |
---|---|---|
committer | Son Ho | 2022-05-05 17:05:10 +0200 |
commit | 643ffc01250e4ebdefe3a33e8b16ea9668db3356 (patch) | |
tree | 286bc223b8e3f639fd6032f4e0df6f403f568521 /tests/misc | |
parent | 678b057f231f8eb99d3dc70ceb99c7a90a854d4d (diff) |
Regenerate the F* files for external.rs
Diffstat (limited to 'tests/misc')
-rw-r--r-- | tests/misc/External.Funs.fst | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/misc/External.Funs.fst b/tests/misc/External.Funs.fst index 21a389ca..3025da55 100644 --- a/tests/misc/External.Funs.fst +++ b/tests/misc/External.Funs.fst @@ -40,13 +40,16 @@ let test_new_non_zero_u32_fwd end (** [external::test_vec] *) -let test_vec_fwd (st : state) : result (state & unit) = +let test_vec_fwd : result unit = let v = vec_new u32 in begin match vec_push_back u32 v 0 with | Fail -> Fail - | Return _ -> Return (st, ()) + | Return _ -> Return () end +(** Unit test for [external::test_vec] *) +let _ = assert_norm (test_vec_fwd = Return ()) + (** [external::custom_swap] *) let custom_swap_fwd (t : Type0) (x : t) (y : t) (st : state) : result (state & t) = @@ -87,3 +90,15 @@ let test_custom_swap_back | Return (x0, y0) -> Return (x0, y0) end +(** [external::test_swap_non_zero] *) +let test_swap_non_zero_fwd (x : u32) (st : state) : result (state & u32) = + begin match swap_fwd u32 x 0 st with + | Fail -> Fail + | Return (st0, _) -> + begin match swap_back u32 x 0 st with + | Fail -> Fail + | Return (x0, _) -> + begin match x0 with | 0 -> Fail | _ -> Return (st0, x0) end + end + end + |