Skip to content

Commit

Permalink
Cosmetic clean-ups
Browse files Browse the repository at this point in the history
  • Loading branch information
jmid committed Apr 17, 2024
1 parent c65989d commit d55af6a
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/bigarray/stm_tests.ml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ struct
Array1.fill ba 0 ;
ba

let cleanup _ = ()
let cleanup _ = ()

let precond n _s = match n with
| _ -> true
let precond _n _s = true

let run n ba = match n with
| Size_in_bytes -> Res (STM.int, Array1.size_in_bytes ba)
Expand All @@ -71,15 +70,15 @@ struct
| Fill n -> Res (result unit exn, protect (Array1.fill ba) n)

let postcond n (s:int list) res = match n, res with
| Size_in_bytes, Res ((Int,_),i) -> i = 8 * (List.length s)
| Size_in_bytes, Res ((Int,_),r) -> r = 8 * (List.length s)
| Get i, Res ((Result (Int,Exn),_), r) ->
if i < 0 || i >= List.length s
then r = Error (Invalid_argument "index out of bounds")
else r = Ok (List.nth s i)
then r = Error (Invalid_argument "index out of bounds")
else r = Ok (List.nth s i)
| Set (i,_), Res ((Result (Unit,Exn),_), r) ->
if i < 0 || i >= List.length s
then r = Error (Invalid_argument "index out of bounds")
else r = Ok ()
then r = Error (Invalid_argument "index out of bounds")
else r = Ok ()
(* STM don't support bigarray type for the moment*)
(* | Sub (i,l), Res ((Result (Array Char,Exn),_), r) ->
if i < 0 || l < 0 || i+l > List.length s
Expand Down

0 comments on commit d55af6a

Please sign in to comment.