(* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. *) open Exapunks open Helpers let () = set_context __FILE__ let () = describe "#void" (fun () -> specify "negative" (fun () -> let f1 = File.create "200" ~contents:[ Int 72; Int 52; Int 4; Int 60 ] in File.void f1 ~-1; let f2 = File.create "200" ~contents:[ Int 72; Int 52; Int 4; Int 60 ] in Alcotest.check t_file "" f2 f1); specify "start" (fun () -> let f1 = File.create "200" ~contents:[ Int 72; Int 52; Int 4; Int 60 ] in File.void f1 0; let f2 = File.create "200" ~contents:[ Int 52; Int 4; Int 60 ] in Alcotest.check t_file "" f2 f1); specify "middle" (fun () -> let f1 = File.create "200" ~contents:[ Int 72; Int 52; Int 4; Int 60 ] in File.void f1 2; let f2 = File.create "200" ~contents:[ Int 72; Int 52; Int 60 ] in Alcotest.check t_file "" f2 f1); specify "end" (fun () -> let f1 = File.create "200" ~contents:[ Int 72; Int 52; Int 4; Int 60 ] in File.void f1 3; let f2 = File.create "200" ~contents:[ Int 72; Int 52; Int 4 ] in Alcotest.check t_file "" f2 f1); specify "past end" (fun () -> let f1 = File.create "200" ~contents:[ Int 72; Int 52; Int 4; Int 60 ] in File.void f1 10; let f2 = File.create "200" ~contents:[ Int 72; Int 52; Int 4; Int 60 ] in Alcotest.check t_file "" f2 f1); ())