summaryrefslogtreecommitdiff
path: root/tests/fstar/misc/External.Funs.fst
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fstar/misc/External.Funs.fst')
-rw-r--r--tests/fstar/misc/External.Funs.fst38
1 files changed, 19 insertions, 19 deletions
diff --git a/tests/fstar/misc/External.Funs.fst b/tests/fstar/misc/External.Funs.fst
index f118a2cf..e26014ac 100644
--- a/tests/fstar/misc/External.Funs.fst
+++ b/tests/fstar/misc/External.Funs.fst
@@ -8,8 +8,8 @@ include External.Opaque
#set-options "--z3rlimit 50 --fuel 1 --ifuel 1"
(** [external::swap]: forward function *)
-let swap_fwd (t : Type0) (x : t) (y : t) (st : state) : result (state & unit) =
- let* (st0, _) = core_mem_swap_fwd t x y st in
+let swap (t : Type0) (x : t) (y : t) (st : state) : result (state & unit) =
+ let* (st0, _) = core_mem_swap t x y st in
let* (st1, _) = core_mem_swap_back0 t x y st st0 in
let* (st2, _) = core_mem_swap_back1 t x y st st1 in
Return (st2, ())
@@ -19,28 +19,29 @@ let swap_back
(t : Type0) (x : t) (y : t) (st : state) (st0 : state) :
result (state & (t & t))
=
- let* (st1, _) = core_mem_swap_fwd t x y st in
+ let* (st1, _) = core_mem_swap t x y st in
let* (st2, x0) = core_mem_swap_back0 t x y st st1 in
let* (_, y0) = core_mem_swap_back1 t x y st st2 in
Return (st0, (x0, y0))
(** [external::test_new_non_zero_u32]: forward function *)
-let test_new_non_zero_u32_fwd
- (x : u32) (st : state) : result (state & core_num_nonzero_non_zero_u32_t) =
- let* (st0, opt) = core_num_nonzero_non_zero_u32_new_fwd x st in
- core_option_option_unwrap_fwd core_num_nonzero_non_zero_u32_t opt st0
+let test_new_non_zero_u32
+ (x : u32) (st : state) : result (state & core_num_nonzero_NonZeroU32_t) =
+ let* (st0, o) = core_num_nonzero_NonZeroU32_new x st in
+ core_option_Option_unwrap core_num_nonzero_NonZeroU32_t o st0
(** [external::test_vec]: forward function *)
-let test_vec_fwd : result unit =
- let v = vec_new u32 in let* _ = vec_push_back u32 v 0 in Return ()
+let test_vec : result unit =
+ let v = alloc_vec_Vec_new u32 in
+ let* _ = alloc_vec_Vec_push u32 v 0 in
+ Return ()
(** Unit test for [external::test_vec] *)
-let _ = assert_norm (test_vec_fwd = Return ())
+let _ = assert_norm (test_vec = Return ())
(** [external::custom_swap]: forward function *)
-let custom_swap_fwd
- (t : Type0) (x : t) (y : t) (st : state) : result (state & t) =
- let* (st0, _) = core_mem_swap_fwd t x y st in
+let custom_swap (t : Type0) (x : t) (y : t) (st : state) : result (state & t) =
+ let* (st0, _) = core_mem_swap t x y st in
let* (st1, x0) = core_mem_swap_back0 t x y st st0 in
let* (st2, _) = core_mem_swap_back1 t x y st st1 in
Return (st2, x0)
@@ -50,15 +51,14 @@ let custom_swap_back
(t : Type0) (x : t) (y : t) (st : state) (ret : t) (st0 : state) :
result (state & (t & t))
=
- let* (st1, _) = core_mem_swap_fwd t x y st in
+ let* (st1, _) = core_mem_swap t x y st in
let* (st2, _) = core_mem_swap_back0 t x y st st1 in
let* (_, y0) = core_mem_swap_back1 t x y st st2 in
Return (st0, (ret, y0))
(** [external::test_custom_swap]: forward function *)
-let test_custom_swap_fwd
- (x : u32) (y : u32) (st : state) : result (state & unit) =
- let* (st0, _) = custom_swap_fwd u32 x y st in Return (st0, ())
+let test_custom_swap (x : u32) (y : u32) (st : state) : result (state & unit) =
+ let* (st0, _) = custom_swap u32 x y st in Return (st0, ())
(** [external::test_custom_swap]: backward function 0 *)
let test_custom_swap_back
@@ -68,8 +68,8 @@ let test_custom_swap_back
custom_swap_back u32 x y st 1 st0
(** [external::test_swap_non_zero]: forward function *)
-let test_swap_non_zero_fwd (x : u32) (st : state) : result (state & u32) =
- let* (st0, _) = swap_fwd u32 x 0 st in
+let test_swap_non_zero (x : u32) (st : state) : result (state & u32) =
+ let* (st0, _) = swap u32 x 0 st in
let* (st1, (x0, _)) = swap_back u32 x 0 st st0 in
if x0 = 0 then Fail Failure else Return (st1, x0)