diff --git a/src/bin_snoop/main_snoop.ml b/src/bin_snoop/main_snoop.ml index 083c3c2b8f21ceddd9f94231005977f8c3a4250a..674c537b7aab3246b580c7f7d4bd6bdf18bef994 100644 --- a/src/bin_snoop/main_snoop.ml +++ b/src/bin_snoop/main_snoop.ml @@ -332,11 +332,6 @@ and get_all_workload_data_files directory = in loop [] -and workload_admits_model model workload_data = - let measure = Measure.load ~filename:workload_data in - match measure with - | Measure.Measurement ((module Bench), _) -> List.mem_assoc model Bench.models - let cull_outliers_cmd workload_data nsigmas save_file = let measure = Measure.load ~filename:workload_data in match measure with diff --git a/src/lib_benchmark/lib_micheline_rewriting/test/test_rewriting.ml b/src/lib_benchmark/lib_micheline_rewriting/test/test_rewriting.ml index 0abeb679a564a65cb9cbbd419068023effa9e773..0c9c905a95b9ef157895c69bfae96f516807f825 100644 --- a/src/lib_benchmark/lib_micheline_rewriting/test/test_rewriting.ml +++ b/src/lib_benchmark/lib_micheline_rewriting/test/test_rewriting.ml @@ -33,31 +33,6 @@ open Tezos_micheline_rewriting open Tezos_protocol_alpha.Protocol -let rec update_contract_script : - ('l, 'p) Micheline.node -> ('l, 'p) Micheline.node = function - | Micheline.Seq - (_, Micheline.Prim (_, Michelson_v1_primitives.I_ADDRESS, [], []) :: l) -> - Micheline.Seq - ( 0, - Micheline.Prim (0, Michelson_v1_primitives.I_ADDRESS, [], []) - :: - Micheline.Prim (0, Michelson_v1_primitives.I_CHAIN_ID, [], []) - :: Micheline.Prim (0, Michelson_v1_primitives.I_PAIR, [], []) :: l ) - | Micheline.Seq (_, a :: l) -> ( - let a' = update_contract_script a in - let b = Micheline.Seq (0, l) in - let b' = update_contract_script b in - match b' with - | Micheline.Seq (_, l') -> Micheline.Seq (0, a' :: l') - | _ -> assert false) - | Micheline.Prim (_, p, l, annot) -> - Micheline.Prim (0, p, List.map update_contract_script l, annot) - | script -> script - -let update_contract_script : Script_repr.expr -> Script_repr.expr = - fun script -> - Micheline.strip_locations (update_contract_script (Micheline.root script)) - module Michelson_signature : Signature.S with type t = Michelson_v1_primitives.prim = struct type t = Michelson_v1_primitives.prim diff --git a/src/lib_client_base/test/bip39_tests.ml b/src/lib_client_base/test/bip39_tests.ml index 5bc6c46511b3d24cc72d01aa7eb14cf8d3377e42..6c29d558d0c618a219bc8d5a52c3a8c99cb8c5aa 100644 --- a/src/lib_client_base/test/bip39_tests.ml +++ b/src/lib_client_base/test/bip39_tests.ml @@ -268,7 +268,9 @@ let vectors () = let words = String.split_on_char ' ' words in let mnemonic = Bip39.of_entropy (Hex.to_bytes entropy) in let words_computed = Bip39.to_words mnemonic in - assert (words = words_computed) ; + if words <> words_computed then ( + Format.printf "%a\n" pp_diff (words, words_computed) ; + failwith "unexpected difference") ; let seed_computed = Bip39.to_seed ~passphrase:(Bytes.of_string "TREZOR") mnemonic in diff --git a/src/lib_lwt_result_stdlib/test/test_fuzzing_option.ml b/src/lib_lwt_result_stdlib/test/test_fuzzing_option.ml index c793f2f775a2a8c41f22133adf88927810121ff4..3812df46a77dde38fa7de11bf2714c30bf2469bc 100644 --- a/src/lib_lwt_result_stdlib/test/test_fuzzing_option.ml +++ b/src/lib_lwt_result_stdlib/test/test_fuzzing_option.ml @@ -284,7 +284,7 @@ let () = ("iter*", Lib_test.Qcheck_helpers.qcheck_wrap TestIter.tests); ("filter*", Lib_test.Qcheck_helpers.qcheck_wrap TestFilter.tests); ("filter_map*", Lib_test.Qcheck_helpers.qcheck_wrap TestFilterMap.tests); - ("map*", Lib_test.Qcheck_helpers.qcheck_wrap TestIter.tests); + ("map*", Lib_test.Qcheck_helpers.qcheck_wrap TestMap.tests); ] in Alcotest.run "Option" tests diff --git a/src/lib_lwt_result_stdlib/test/test_generic.ml b/src/lib_lwt_result_stdlib/test/test_generic.ml index 5cd6b8a218852c5e8a772b3bc14870773d97657a..d5a2dd67ce49adccc6bd45e9b1ccd3e5d4d67afd 100644 --- a/src/lib_lwt_result_stdlib/test/test_generic.ml +++ b/src/lib_lwt_result_stdlib/test/test_generic.ml @@ -65,8 +65,6 @@ module Testing = struct | Ok o -> "ok(" ^ f o ^ ")" | Error e -> "error(" ^ g e ^ ")" - let str = Fun.id - let unit _ = "()" let t _ _ = "T" @@ -77,10 +75,6 @@ module Testing = struct let es n m = Lwt.return @@ if n = m then Error m else Ok () - let exn n m = if n = m then raise (Nope m) else () - - let exn_s n m = Lwt.return @@ if n = m then raise (Nope m) else () - let exn_es n m = Lwt.return_ok @@ if n = m then raise (Nope m) else () let exn_now _ = raise (Nope 2048) @@ -103,10 +97,6 @@ module Testing = struct let es n _acc m = Lwt.return @@ if n = m then Error m else Ok m - let exn n m = if n = m then raise (Nope m) else m - - let exn_s n _acc m = Lwt.return @@ if n = m then raise (Nope m) else m - let exn_es n _acc m = Lwt.return_ok @@ if n = m then raise (Nope m) else m let exn_now _ _ = raise (Nope 2048) @@ -130,10 +120,6 @@ module Testing = struct let es n m = Lwt.return @@ if n = m then Error m else Ok (m + 1000) - let exn n m = if n = m then raise (Nope m) else m + 1000 - - let exn_s n m = Lwt.return @@ if n = m then raise (Nope m) else m + 1000 - let exn_es n m = Lwt.return_ok @@ if n = m then raise (Nope m) else m + 1000 let exn_now _ = raise (Nope 2048) diff --git a/src/lib_p2p/test/test_p2p_banned_peers.ml b/src/lib_p2p/test/test_p2p_banned_peers.ml index 614def6eee05440063a44ecfcb11284625362d7b..e3d44852a8787ccdc243b93f90cf24231ea199ac 100644 --- a/src/lib_p2p/test/test_p2p_banned_peers.ml +++ b/src/lib_p2p/test/test_p2p_banned_peers.ml @@ -110,7 +110,10 @@ let test_clear _ = The GC is configured to run 16 times in 0.1 seconds. Since 16 is hardcoded as the number of GCs to evict a peer from the table (see p2p_acl.ml), the table must be empty at the end. *) -let test_gc _ = + +(* flaky test, see below *) + +let _test_gc _ = let set = P2p_acl.create ~peer_id_size:10 @@ -143,7 +146,7 @@ let () = ("empty", test_empty); ("ban", test_ban); ("clear", test_clear); - (* FIXME flappy test: + (* FIXME flaky test: ("test_gc", test_gc) *) ] ); diff --git a/src/lib_p2p/test/test_p2p_socket.ml b/src/lib_p2p/test/test_p2p_socket.ml index 3752db82540d82a5f345d46ad3a0be1b4368795f..a9f7dcdc7875a03b6657ef4a630740e9e62b427b 100644 --- a/src/lib_p2p/test/test_p2p_socket.ml +++ b/src/lib_p2p/test/test_p2p_socket.ml @@ -42,14 +42,8 @@ let tzassert b pos = let p (file, lnum, cnum, _) = (file, lnum, cnum) in if b then return_unit else fail (Exn (Assert_failure (p pos))) -let id0 = - (* Luckily, this will be an insufficient proof of work! *) - P2p_identity.generate (Crypto_box.make_pow_target 0.) - let high_pow_target = Crypto_box.make_pow_target 100. -type metadata = unit - let sync ch = Process.Channel.push ch () >>=? fun () -> Process.Channel.pop ch >>=? fun () -> return_unit @@ -152,7 +146,7 @@ module Crypto_test = struct | false -> fail Tezos_p2p_services.P2p_errors.Decipher_error | true -> return msg - let (sk, pk, pkh) = Crypto_box.random_keypair () + let (sk, pk, _pkh) = Crypto_box.random_keypair () let zero_nonce = Crypto_box.zero_nonce @@ -184,8 +178,6 @@ end server check it against a unreachable pow target. *) module Pow_check = struct - let encoding = Data_encoding.bytes - let is_failing = function | Error (P2p_errors.Not_enough_proof_of_work _ :: _) -> true | _ -> false @@ -395,8 +387,6 @@ end module Close_on_read = struct let encoding = Data_encoding.bytes - let simple_msg = Rand.generate (1 lsl 4) - let server ch sched socket = accept sched socket >>=? fun (_info, auth_fd) -> P2p_socket.accept ~canceler auth_fd encoding >>=? fun conn -> diff --git a/src/lib_protocol_environment/test/test_mem_context_array_theory.ml b/src/lib_protocol_environment/test/test_mem_context_array_theory.ml index b4d0d1ceff05279e0a9456ce7621c731b8618924..376e1319cf20a70cb9c104c465d623630adc940a 100644 --- a/src/lib_protocol_environment/test/test_mem_context_array_theory.ml +++ b/src/lib_protocol_environment/test/test_mem_context_array_theory.ml @@ -54,8 +54,6 @@ type key = Context.key let equal_key : key -> key -> bool = fun (a : string list) (b : string list) -> Stdlib.( = ) a b -type value = Context.value - (** Using [QCheck.small_list] for performance reasons: using [QCheck.list] here makes the file 40 times slower, which is not acceptable. *) let key_arb = QCheck.small_list QCheck.string diff --git a/src/lib_proxy/test/test_fuzzing_light.ml b/src/lib_proxy/test/test_fuzzing_light.ml index 9f9bfe085cc38e0af2e39beb6a732c392df64f0c..1feec86c3c44edf58456bd230a81e3217495bc8a 100644 --- a/src/lib_proxy/test/test_fuzzing_light.ml +++ b/src/lib_proxy/test/test_fuzzing_light.ml @@ -509,7 +509,8 @@ module Consensus = struct method get_logs = List.rev !rev_logs end - let print_keys l = + (* used for debugging *) + let _print_keys l = let l = List.map (fun s -> "\"" ^ s ^ "\"") l in "[" ^ String.concat "; " l ^ "]" diff --git a/src/lib_requester/test/test_requester.ml b/src/lib_requester/test/test_requester.ml index a558e3ee1bfeb504d426679cda4f2c00472954c1..2e1545050df2b0d7a9e223b603d10f69387f8094 100644 --- a/src/lib_requester/test/test_requester.ml +++ b/src/lib_requester/test/test_requester.ml @@ -64,8 +64,6 @@ let is_resolved p = match Lwt.state p with Return _ -> true | _ -> false let is_pending p = match Lwt.state p with Sleep -> true | _ -> false -let is_failed p = match Lwt.state p with Fail _ -> true | _ -> false - (** Start tests *) (** Creates a requester with [Disk_table] (of size 16) as the store. *) diff --git a/src/lib_shell/bench/bench_tool.ml b/src/lib_shell/bench/bench_tool.ml index 73cce412e61bfeaee120e3b9ac16495ed109667b..ee352794c00fddda7291401debd018d1994adecf 100644 --- a/src/lib_shell/bench/bench_tool.ml +++ b/src/lib_shell/bench/bench_tool.ml @@ -120,8 +120,6 @@ let choose_exp_nat n = let u = Random.float 1. in -.log u /. lambda |> int_of_float -let pi = 3.1415926502 - let two_pi = 2. *. 3.1415926502 let round x = x +. 0.5 |> int_of_float diff --git a/src/lib_shell/test/test_locator.ml b/src/lib_shell/test/test_locator.ml index e142a0ae52ebf9ff6c0fe69a8bc471bcf31daa51..6b8b2a14a12afb350d60ccf9f331ea29a4f0cb9c 100644 --- a/src/lib_shell/test/test_locator.ml +++ b/src/lib_shell/test/test_locator.ml @@ -216,6 +216,7 @@ let rec repeat f n = (* ----------------------------------------------------- *) +(* let print_block b = Printf.printf "%6i %s\n" @@ -225,7 +226,7 @@ let print_block b = let print_block_h chain bh = Store.Block.read_block_opt chain bh >|= WithExceptions.Option.get ~loc:__LOC__ >|= fun b -> print_block b - +*) (* returns the predecessor at distance one, reading the header *) let linear_predecessor chain_store (bh : Block_hash.t) : Block_hash.t option Lwt.t = diff --git a/src/lib_shell/test/test_prevalidator_classification.ml b/src/lib_shell/test/test_prevalidator_classification.ml index 2588a72377a110998a798b84870ef2f99283f60b..88d53856d7605998efd1c22db55d957c9a57b60c 100644 --- a/src/lib_shell/test/test_prevalidator_classification.ml +++ b/src/lib_shell/test/test_prevalidator_classification.ml @@ -791,6 +791,7 @@ let () = test_map_remove_add; test_map_add_remove; test_flush; + test_is_applied; test_is_in_mempool; test_none; ]; diff --git a/src/lib_shell/test/test_prevalidator_classification_operations.ml b/src/lib_shell/test/test_prevalidator_classification_operations.ml index c509ad56d07f9210e44326e4008330289b19aa51..003f1a192a7c7d2e250acdeb79eb64596cbd6331 100644 --- a/src/lib_shell/test/test_prevalidator_classification_operations.ml +++ b/src/lib_shell/test/test_prevalidator_classification_operations.ml @@ -88,7 +88,7 @@ module Tree = struct (* Note that I intentionally do not use {!Format} as automatic line cutting makes reading the output (when debugging) harder. *) - let rec to_string elem_to_string t indent = + let rec to_string_aux elem_to_string t indent = match t with | Leaf e -> indent ^ elem_to_string e | Node1 (e, subt) -> @@ -97,17 +97,18 @@ module Tree = struct "%s%s\n%s" indent (elem_to_string e) - (to_string elem_to_string subt indentpp) + (to_string_aux elem_to_string subt indentpp) | Node2 (e, t1, t2) -> let indentpp = indent ^ " " in Printf.sprintf "%s%s\n%s\n%s" indent (elem_to_string e) - (to_string elem_to_string t1 indentpp) - (to_string elem_to_string t2 indentpp) + (to_string_aux elem_to_string t1 indentpp) + (to_string_aux elem_to_string t2 indentpp) - let to_string elem_to_string t = to_string elem_to_string t "" + (* [to_string] is unused but useful when debugging, renaming it to [_to_string] to keep it around *) + let _to_string elem_to_string t = to_string_aux elem_to_string t "" let rec depth = function | Leaf _ -> 1 @@ -270,8 +271,10 @@ module Block = struct in Format.asprintf "%a:[%s]" Block_hash.pp t.hash ops_string + (* [pp_list] is unused but useful when debugging, renaming it to [_pp_list] to keep it around *) + (** Pretty prints a list of {!t}, using [sep] as the separator *) - let pp_list ~(sep : string) (ts : t list) = + let _pp_list ~(sep : string) (ts : t list) = String.concat sep @@ List.map to_string ts module Ord = struct diff --git a/src/lib_stdlib/test/dune b/src/lib_stdlib/test/dune index 4a5f1f1cd30d53c66ae7cf1723cad444a057a8f6..53f7e3fb995c490731f9968bd82e299ba9c6d392 100644 --- a/src/lib_stdlib/test/dune +++ b/src/lib_stdlib/test/dune @@ -4,7 +4,6 @@ test_tzList test_bounded_heap test_tzString - test_arrays test_fallbackArray test_functionalArray test_lwt_pipe diff --git a/src/lib_stdlib/test/test_arrays.ml b/src/lib_stdlib/test/test_arrays.ml index 4c2422330e5b0d665fb2400e8f07175b55b573a6..3675ffb27d63ae8b4efb231e5e34a45ed0224a05 100644 --- a/src/lib_stdlib/test/test_arrays.ml +++ b/src/lib_stdlib/test/test_arrays.ml @@ -43,8 +43,6 @@ module Make (A : sig val fallback : 'a t -> 'a - val length : 'a t -> int - val get : 'a t -> int -> 'a val set : 'a t -> int -> 'a -> 'a t @@ -67,9 +65,6 @@ struct let on_samples f () = List.iter f samples - let check_make_and_length (s, d, _) = - if not (length (make s d) = s) then fail "length (make s d) = s" - let check_make_and_fallback (s, d, _) = assert (s < Sys.max_array_length) ; if not (fallback (make s d) = d) then fail "fallback (make s d) = d" diff --git a/src/lib_store/test/test_legacy.ml b/src/lib_store/test/test_legacy.ml index 60f36f52456d9337b5d6686f2fb4cd4605d873d9..6a37d423273ded0254858bde8ac068dc54d79531 100644 --- a/src/lib_store/test/test_legacy.ml +++ b/src/lib_store/test/test_legacy.ml @@ -27,38 +27,6 @@ open Test_utils open Legacy_utils -(* From "legacy chain_validator"*) -let may_update_checkpoint chain_state new_head = - Legacy_state.Chain.checkpoint chain_state >>= fun checkpoint -> - Legacy_state.Block.last_allowed_fork_level new_head >>=? fun new_level -> - if new_level <= checkpoint.shell.level then return_unit - else - let state = Legacy_state.Chain.global_state chain_state in - Legacy_state.history_mode state >>= fun history_mode -> - let head_level = Legacy_state.Block.level new_head in - Legacy_state.Block.predecessor_n - new_head - (Int32.to_int (Int32.sub head_level new_level)) - >>= function - | None -> assert false (* should not happen *) - | Some new_checkpoint -> ( - Legacy_state.Block.read_opt chain_state new_checkpoint >>= function - | None -> assert false (* should not happen *) - | Some new_checkpoint -> ( - let new_checkpoint = Legacy_state.Block.header new_checkpoint in - match history_mode with - | History_mode.Legacy.Archive -> - Legacy_state.Chain.set_checkpoint chain_state new_checkpoint - >>= fun () -> return_unit - | Full -> - Legacy_state.Chain.set_checkpoint_then_purge_full - chain_state - new_checkpoint - | Rolling -> - Legacy_state.Chain.set_checkpoint_then_purge_rolling - chain_state - new_checkpoint)) - let assert_presence new_chain_store previously_baked_blocks ?savepoint ?caboose = function | History_mode.Archive -> diff --git a/src/proto_010_PtGRANAD/lib_client/test/test_michelson_v1_macros.ml b/src/proto_010_PtGRANAD/lib_client/test/test_michelson_v1_macros.ml index 9d3004b445f160120796a0e50e770910d9b83672..75316f163dfaa6b68c3071331e8fd4aeb5c4c2be 100644 --- a/src/proto_010_PtGRANAD/lib_client/test/test_michelson_v1_macros.ml +++ b/src/proto_010_PtGRANAD/lib_client/test/test_michelson_v1_macros.ml @@ -705,20 +705,6 @@ let assert_unexpansion original ex = ok () | _ :: _ -> Error errors -let assert_unexpansion_consistent original = - let ({Michelson_v1_parser.expanded; _}, errors) = - let source = print (Micheline.strip_locations original) in - Michelson_v1_parser.expand_all ~source ~original - in - match errors with - | _ :: _ -> Error errors - | [] -> - let {Michelson_v1_parser.unexpanded; _} = - Michelson_v1_printer.unparse_expression expanded - in - Assert.equal ~print unexpanded (Micheline.strip_locations original) ; - ok () - (** Unexpanding "UNIT; FAILWITH" yields "FAIL" *) diff --git a/src/proto_010_PtGRANAD/lib_protocol/test/saturation_fuzzing.ml b/src/proto_010_PtGRANAD/lib_protocol/test/saturation_fuzzing.ml index 019a08f0926e7466928a006b9017eaae051b59a8..3bfbf2ec2b32e5e384f4c9a52e33a47b7c1b5673 100644 --- a/src/proto_010_PtGRANAD/lib_protocol/test/saturation_fuzzing.ml +++ b/src/proto_010_PtGRANAD/lib_protocol/test/saturation_fuzzing.ml @@ -171,7 +171,7 @@ let tests_add_sub = [test_add_sub; test_sub_add] let tests_boundaries = [test_leq_saturated; test_geq_zero] -let tests = +let () = Alcotest.run "Saturation" [ diff --git a/src/proto_011_PtHangz2/lib_benchmark/lib_benchmark_type_inference/test/test_inference.ml b/src/proto_011_PtHangz2/lib_benchmark/lib_benchmark_type_inference/test/test_inference.ml index 463a30657f96e6051376787ecd9e1851d1c53b68..93aa250223082abc643466e7e8162f4d81a23989 100644 --- a/src/proto_011_PtHangz2/lib_benchmark/lib_benchmark_type_inference/test/test_inference.ml +++ b/src/proto_011_PtHangz2/lib_benchmark/lib_benchmark_type_inference/test/test_inference.ml @@ -269,28 +269,6 @@ end module Test6 = struct open Instructions - let program_str = - "parameter unit ;\n\ - storage unit ;\n\ - code { PUSH int 0 ;\n\ - \ PUSH int 100 ;\n\ - \ SWAP ;\n\ - \ DROP ;\n\ - \ DROP ;\n\ - \ DROP ;\n\ - \ PUSH unit Unit ;\n\ - \ PUSH bool False ;\n\ - \ PUSH unit Unit ;\n\ - \ PUSH int 4073851221413541140 ;\n\ - \ PUSH string \"n\" ;\n\ - \ PUSH string \"k\" ;\n\ - \ PUSH int 13919897678870462893 ;\n\ - \ PUSH int 100 ;\n\ - \ ABS ;\n\ - \ DROP ;\n\ - \ DIP { CONCAT } ;\n\ - \ COMPARE }" - (* We remove a chunk from a well-typed program to make it ill-typed, and expect the type inference to fail *) let program = diff --git a/src/proto_011_PtHangz2/lib_client/test/test_michelson_v1_macros.ml b/src/proto_011_PtHangz2/lib_client/test/test_michelson_v1_macros.ml index 124625c31e8682c048eb482e4398ff767a0d8361..8ddf7d8d8abdf0a8f1db1a68f6c0036a7232f35f 100644 --- a/src/proto_011_PtHangz2/lib_client/test/test_michelson_v1_macros.ml +++ b/src/proto_011_PtHangz2/lib_client/test/test_michelson_v1_macros.ml @@ -705,20 +705,6 @@ let assert_unexpansion original ex = ok () | _ :: _ -> Error errors -let assert_unexpansion_consistent original = - let ({Michelson_v1_parser.expanded; _}, errors) = - let source = print (Micheline.strip_locations original) in - Michelson_v1_parser.expand_all ~source ~original - in - match errors with - | _ :: _ -> Error errors - | [] -> - let {Michelson_v1_parser.unexpanded; _} = - Michelson_v1_printer.unparse_expression expanded - in - Assert.equal ~print unexpanded (Micheline.strip_locations original) ; - ok () - (** Unexpanding "UNIT; FAILWITH" yields "FAIL" *) diff --git a/src/proto_011_PtHangz2/lib_protocol/test/saturation_fuzzing.ml b/src/proto_011_PtHangz2/lib_protocol/test/saturation_fuzzing.ml index 88672c7527c3a1e3fff8cb94d3ca9e2d79ee9a0a..c021d2c6b9f76f914908104984b5619bd6041a6f 100644 --- a/src/proto_011_PtHangz2/lib_protocol/test/saturation_fuzzing.ml +++ b/src/proto_011_PtHangz2/lib_protocol/test/saturation_fuzzing.ml @@ -171,7 +171,7 @@ let tests_add_sub = [test_add_sub; test_sub_add] let tests_boundaries = [test_leq_saturated; test_geq_zero] -let tests = +let () = Alcotest.run "Saturation" [ diff --git a/src/proto_011_PtHangz2/lib_protocol/test/test_script_comparison.ml b/src/proto_011_PtHangz2/lib_protocol/test/test_script_comparison.ml index 22fd1a82f2f75653bedb050874f70d7c33bfed01..97d4083450c1e70464544f84ce540c62b933a927 100644 --- a/src/proto_011_PtHangz2/lib_protocol/test/test_script_comparison.ml +++ b/src/proto_011_PtHangz2/lib_protocol/test/test_script_comparison.ml @@ -355,7 +355,7 @@ let test_pack_unpack = (Some x) (unpack_comparable_data ty (pack_comparable_data ty x))) -let tests = +let () = Alcotest.run "Script_comparison" [ diff --git a/src/proto_alpha/lib_benchmark/lib_benchmark_type_inference/test/test_inference.ml b/src/proto_alpha/lib_benchmark/lib_benchmark_type_inference/test/test_inference.ml index 463a30657f96e6051376787ecd9e1851d1c53b68..93aa250223082abc643466e7e8162f4d81a23989 100644 --- a/src/proto_alpha/lib_benchmark/lib_benchmark_type_inference/test/test_inference.ml +++ b/src/proto_alpha/lib_benchmark/lib_benchmark_type_inference/test/test_inference.ml @@ -269,28 +269,6 @@ end module Test6 = struct open Instructions - let program_str = - "parameter unit ;\n\ - storage unit ;\n\ - code { PUSH int 0 ;\n\ - \ PUSH int 100 ;\n\ - \ SWAP ;\n\ - \ DROP ;\n\ - \ DROP ;\n\ - \ DROP ;\n\ - \ PUSH unit Unit ;\n\ - \ PUSH bool False ;\n\ - \ PUSH unit Unit ;\n\ - \ PUSH int 4073851221413541140 ;\n\ - \ PUSH string \"n\" ;\n\ - \ PUSH string \"k\" ;\n\ - \ PUSH int 13919897678870462893 ;\n\ - \ PUSH int 100 ;\n\ - \ ABS ;\n\ - \ DROP ;\n\ - \ DIP { CONCAT } ;\n\ - \ COMPARE }" - (* We remove a chunk from a well-typed program to make it ill-typed, and expect the type inference to fail *) let program = diff --git a/src/proto_alpha/lib_client/test/test_michelson_v1_macros.ml b/src/proto_alpha/lib_client/test/test_michelson_v1_macros.ml index 9d3004b445f160120796a0e50e770910d9b83672..75316f163dfaa6b68c3071331e8fd4aeb5c4c2be 100644 --- a/src/proto_alpha/lib_client/test/test_michelson_v1_macros.ml +++ b/src/proto_alpha/lib_client/test/test_michelson_v1_macros.ml @@ -705,20 +705,6 @@ let assert_unexpansion original ex = ok () | _ :: _ -> Error errors -let assert_unexpansion_consistent original = - let ({Michelson_v1_parser.expanded; _}, errors) = - let source = print (Micheline.strip_locations original) in - Michelson_v1_parser.expand_all ~source ~original - in - match errors with - | _ :: _ -> Error errors - | [] -> - let {Michelson_v1_parser.unexpanded; _} = - Michelson_v1_printer.unparse_expression expanded - in - Assert.equal ~print unexpanded (Micheline.strip_locations original) ; - ok () - (** Unexpanding "UNIT; FAILWITH" yields "FAIL" *) diff --git a/src/proto_alpha/lib_plugin/test/test_consensus_filter.ml b/src/proto_alpha/lib_plugin/test/test_consensus_filter.ml index 73f82b7ff007ee297674ca6801ad258568d0dc64..6d8551b2f2034cb32fe984c56c6bbf41a5935f94 100644 --- a/src/proto_alpha/lib_plugin/test/test_consensus_filter.ml +++ b/src/proto_alpha/lib_plugin/test/test_consensus_filter.ml @@ -91,10 +91,6 @@ module Generator = struct decorate ?prefix ?suffix Int32.to_string @@ map ~rev:Int32.to_int Int32.of_int small_nat - let small_signed_64 ?prefix ?suffix () = - decorate ?prefix ?suffix Int64.to_string - @@ map ~rev:Int64.to_int Int64.of_int small_signed_int - let small_signed_32 ?prefix ?suffix () = decorate ?prefix ?suffix Int32.to_string @@ map ~rev:Int32.to_int Int32.of_int small_signed_int @@ -487,7 +483,7 @@ let test_not_acceptable_next_level = ~now_timestamp >|? not)) -let tests = +let () = Alcotest.run "Filter" [ diff --git a/src/proto_alpha/lib_protocol/test/saturation_fuzzing.ml b/src/proto_alpha/lib_protocol/test/saturation_fuzzing.ml index 88672c7527c3a1e3fff8cb94d3ca9e2d79ee9a0a..c021d2c6b9f76f914908104984b5619bd6041a6f 100644 --- a/src/proto_alpha/lib_protocol/test/saturation_fuzzing.ml +++ b/src/proto_alpha/lib_protocol/test/saturation_fuzzing.ml @@ -171,7 +171,7 @@ let tests_add_sub = [test_add_sub; test_sub_add] let tests_boundaries = [test_leq_saturated; test_geq_zero] -let tests = +let () = Alcotest.run "Saturation" [ diff --git a/src/proto_alpha/lib_protocol/test/test_sampler.ml b/src/proto_alpha/lib_protocol/test/test_sampler.ml index 8f3a72bb6930a878f0d717d7823a0dcc8895c8e4..5ffd78e1c6eb70b2346c9aa806345d866bb5c6c5 100644 --- a/src/proto_alpha/lib_protocol/test/test_sampler.ml +++ b/src/proto_alpha/lib_protocol/test/test_sampler.ml @@ -42,26 +42,6 @@ module Int = struct let hash = Hashtbl.hash end -let pp_array pp_elt fmtr array = - Format.pp_print_list - ~pp_sep:(fun fmtr () -> Format.fprintf fmtr ",") - pp_elt - fmtr - (Array.to_list array) - -let compare_array cmp (a1 : 'a array) (a2 : 'a array) = - let c = Int.compare (Array.length a1) (Array.length a2) in - if c <> 0 then c - else - let exception Not_equal of int in - try - for i = 0 to Array.length a1 - 1 do - let c = cmp a1.(i) a2.(i) in - if c <> 0 then raise (Not_equal c) else () - done ; - 0 - with Not_equal c -> c - let equal_array elt_eq arr1 arr2 = Array.length arr1 = Array.length arr2 && Stdlib.List.for_all2 elt_eq (Array.to_list arr1) (Array.to_list arr2) @@ -140,9 +120,6 @@ let pp_dist pp fmtr dist = fmtr l -let l1 (dist : ('a * Q.t) array) pmf = - Array.fold_left (fun acc (n, q) -> Q.(acc + abs (pmf n - q))) Q.zero dist - let linf (dist : ('a * Q.t) array) pmf = Array.fold_left (fun acc (n, q) -> Q.(max acc (abs (pmf n - q)))) Q.zero dist diff --git a/src/proto_alpha/lib_protocol/test/test_script_comparison.ml b/src/proto_alpha/lib_protocol/test/test_script_comparison.ml index 22fd1a82f2f75653bedb050874f70d7c33bfed01..97d4083450c1e70464544f84ce540c62b933a927 100644 --- a/src/proto_alpha/lib_protocol/test/test_script_comparison.ml +++ b/src/proto_alpha/lib_protocol/test/test_script_comparison.ml @@ -355,7 +355,7 @@ let test_pack_unpack = (Some x) (unpack_comparable_data ty (pack_comparable_data ty x))) -let tests = +let () = Alcotest.run "Script_comparison" [