text stringlengths 0 601k |
|---|
let get_ok = function Ok x -> x | Error s -> QCheck2 . Test . fail_report s |
let test_merkle_tree_to_irmin_tree_preserves_simple_tree = QCheck2 . Test . make ~ name : " merkle_tree_to_irmin_tree mtree |> irmin_tree_to_simple_tree = \ merkle_tree_to_simple_tree mtree " ~ print : print_merkle_tree merkle_tree_gen @@ fun mtree -> let repo = Lwt_main . run ( Store . Tree . make_repo ( ) ) in let me... |
let filter_none : ' a option list -> ' a list = List . filter_map Fun . id |
let rec remove_data_in_node = let open Tezos_shell_services . Block_services in function | Hash _ as x -> Some x | Data _ -> None | Continue mtree -> let mtree ' = remove_data_in_tree mtree in if TzString . Map . is_empty mtree ' then None else Some ( Continue mtree ' ) let pairs = TzString . Map . bindings mtree in le... |
let test_contains_merkle_tree = QCheck2 . Test . make ~ name " : contains_merkle_tree ( merkle_tree_to_irmin_tree mtree ) mtree = true " ~ print : print_merkle_tree merkle_tree_gen @@ fun mtree -> let mtree = remove_data_in_tree mtree in let repo = Lwt_main . run ( Store . Tree . make_repo ( ) ) in let irmin_tree = Lwt... |
let test_union_irmin_empty = QCheck2 . Test . make ~ name : " union_irmin_tree_merkle_tree empty mtree = merkle_tree_to_irmin_tree \ mtree " ~ print : print_merkle_tree merkle_tree_gen @@ fun mtree -> let repo = Lwt_main . run ( Store . Tree . make_repo ( ) ) in let direct_tree = Lwt_main . run @@ Merkle . merkle_tree_... |
let test_union_translation = QCheck2 . Test . make ~ name : " union_irmin_tree_merkle_tree ( merkle_tree_to_irmin_tree mtree ) mtree = \ merkle_tree_to_irmin_tree mtree " ~ print : print_merkle_tree merkle_tree_gen @@ fun mtree -> let repo = Lwt_main . run ( Store . Tree . make_repo ( ) ) in let direct_tree = Lwt_main ... |
let rec union_merkle_node n1 n2 = let open Tezos_shell_services . Block_services in match ( n1 , n2 ) with | ( Hash h1 , Hash h2 ) when h1 = h2 -> Some n1 | ( Data raw_context1 , Data raw_context2 ) when raw_context1 = raw_context2 -> Some n1 | ( Continue mtree1 , Continue mtree2 ) -> ( match union_merkle_tree mtree1 m... |
let _test_union_direct = let open QCheck2 in Test . make ~ name : " union_irmin_tree_merkle_tree ( merkle_tree_to_irmin_tree mtree ) mtree = \ merkle_tree_to_irmin_tree mtree " ~ print ( : Print . pair print_merkle_tree print_merkle_tree ) ( Gen . pair merkle_tree_gen merkle_tree_gen ) @@ fun ( mtree1 , mtree2 ) -> mat... |
let _test_union_commutation = let open QCheck2 in Test . make ~ name : " union_irmin_tree_merkle_tree ( union_irmin_tree_merkle_tree empty \ mtree1 ) mtree2 = union_irmin_tree_merkle_tree \ ( union_irmin_tree_merkle_tree empty mtree2 ) mtree1 " ~ print ( : Print . pair print_merkle_tree print_merkle_tree ) ( Gen . pair... |
let test_union_merkle_empty = QCheck2 . Test . make ~ name " : union_irmin_tree_merkle_tree tree empty = tree " irmin_tree_gen @@ fun tree -> let repo = Lwt_main . run ( Store . Tree . make_repo ( ) ) in let res = Lwt_main . run @@ Merkle . union_irmin_tree_merkle_tree repo tree TzString . Map . empty |> get_ok in Ligh... |
let test_shape_ignores_key = let open QCheck2 in Test . make ~ name " : trees_shape_match ignores the key " ~ print : Print . ( quad print_merkle_tree ( list string ) print_merkle_node print_merkle_node ) Gen . ( quad merkle_tree_gen ( list string ) merkle_node_gen merkle_node_gen ) @@ fun ( tree , key , node1 , node2 ... |
module HashStability = struct let make_tree_shallow repo tree = let hash = Store . Tree . hash tree in let data = match Store . Tree . kind tree with | ` Value -> ` Contents hash | ` Tree -> ` Node hash in Store . Tree . shallow repo data let rec make_partial_shallow_tree repo tree = let open Lwt_syntax in if ( Store .... |
let check_tree_eq = qcheck_eq ~ pp : Store . Tree . pp ~ eq : Store . Tree . equal |
module AddTree = struct let test_add_tree = let open QCheck2 in Test . make ~ name : " let tree ' = Store . Tree . add_tree tree key at_key in \ Store . Tree . find_tree tree ' key = at_key " ~ print : Print . ( triple HashStability . print_tree_and_shallow ( list string ) print_tree ) Gen . ( triple HashStability . tr... |
module Consensus = struct let ( chain , block ) = ( ` Main , ` Head 0 ) class mock_rpc_context : RPC_context . simple = object method call_service : ' m ' p ' q ' i ' o . ( ( [ < Resto . meth ] as ' m ) , unit , ' p , ' q , ' i , ' o ) RPC_service . t -> ' p -> ' q -> ' i -> ' o tzresult Lwt . t = assert false end let ... |
let add_test_consensus ( min_agreement , honest , rogue , consensus_expected ) = let open QCheck2 in assert ( honest > 0 ) ; let honest = honest - 1 in Test . make ~ name : ( Printf . sprintf " min_agreement =% f , honest =% d , rogue =% d consensus_expected =% b " min_agreement honest rogue consensus_expected ) ~ prin... |
let test_consensus_spec = let open QCheck2 in let open Gen in let min_agreement_gen = 0 -- 100 in let honest_gen = 1 -- 1000 in let rogue_gen = 0 -- 1000 in let key_gen = small_list ( small_string ? gen : None ) in Test . make ~ name : " test_consensus min_agreement honest rogue . . . = min_agreeing_endpoints \ min_agr... |
let ( ) = Alcotest . run " Mode Light " [ ( " Hash stability " , qcheck_wrap [ HashStability . test_hash_stability ; AddTree . test_add_tree ] ) ; ( " Consensus consistency examples " , qcheck_wrap ~ rand ( : Random . State . make [ | 348980449 ] ) | @@ List . map add_test_consensus [ ( 1 . 0 , 2 , 0 , true ) ; ( 1 . 0... |
module ListWithBase = struct type ' a elt = ' a include Support . Lib . List let of_list = Fun . id let to_list = Fun . id let name = " List " let pp = Format . pp_print_list Format . pp_print_int end |
module type F = functor ( S : module type of ListWithBase ) -> sig val tests : QCheck . Test . t list end |
let wrap ( name , ( module Test : F ) ) = let module M = Test ( ListWithBase ) in ( name , qcheck_wrap M . tests ) |
let ( ) = let name = " Test_fuzzing_list " in let tests = [ ( " TestIterFold " , ( module TestIterFold : F ) ) ; ( " TestRevMapRevMap " , ( module TestRevMapRevMap : F ) ) ; ( " Filters " , ( module TestFilters : F ) ) ; ( " Partitions " , ( module TestPartitions : F ) ) ; ( " PartitionMap " , ( module TestPartitionMap... |
let chain_id_gen = QCheck2 . Gen . ( map Chain_id . of_string string ) |
let test_config_file_has_priority_over_default_value from_config_file_val = let expected = from_config_file_val in let actual = Chain_id . choose ~ from_config_file ( : Some from_config_file_val ) in let pp = Tezos_crypto . Chain_id . pp in qcheck_eq ' ~ pp ~ expected ~ actual ( ) |
let test_prioritize_config_file = QCheck2 . Test . make ~ name : " Chain_id . choose always prioritizes the config file over the default \ value " chain_id_gen test_config_file_has_priority_over_default_value |
let ( ) = Alcotest . run " Fuzzing_mockup_args " [ ( " Chain_id . choose " , qcheck_wrap [ test_prioritize_config_file ] ) ] |
module TestIter = struct open QCheck open Monad let iter = Test . make ~ name " { : Option , List ( [ 01 ] ) } . iter " ( triple Test_fuzzing_helpers . Fn . arith one maybe ) ( fun ( Fun ( _ , fn ) , init , input ) -> eq ( let acc = ref init in Option . iter ( IterOf . fn acc fn ) input ; ! acc ) ( let acc = ref init i... |
module TestFilter = struct open QCheck open Monad let filter = Test . make ~ name " { : Option , List ( [ 01 ] ) } . filter " ( triple Test_fuzzing_helpers . Fn . pred one maybe ) ( fun ( fn , const , input ) -> eq ( Option . filter ( CondOf . fn fn const ) input ) ( List . filter ( CondOf . fn fn const ) ( Option . to... |
module TestFilterMap = struct open QCheck open Monad let filter_map = Test . make ~ name " { : Option , List ( [ 01 ] ) } . filter_map " ( quad Test_fuzzing_helpers . Fn . pred Test_fuzzing_helpers . Fn . arith one maybe ) ( fun ( pred , Fun ( _ , arith ) , const , input ) -> eq ( Option . filter_map ( FilterMapOf . fn... |
module TestMap = struct open QCheck open Monad let map = Test . make ~ name " { : Option , List ( [ 01 ] ) } . map " ( triple Test_fuzzing_helpers . Fn . arith one maybe ) ( fun ( Fun ( _ , fn ) , const , input ) -> eq ( Option . map ( MapOf . fn const fn ) input ) ( List . map ( MapOf . fn const fn ) ( Option . to_lis... |
let ( ) = let tests = [ ( " 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... |
let key_gen = QCheck2 . Gen . ( small_list ( small_string ? gen : None ) ) |
let print_key = QCheck2 . Print . ( list string ) |
let tree_gen = let open Lwt_syntax in let rec mk_tree acc sets = match sets with | [ ] -> Lwt . return acc | ( key , value ) :: tl -> ( let * v = Tree . add_leaf acc key value in match v with | Tezos_proxy . Proxy . Mutation -> ( mk_tree [ @ ocaml . tailcall ] ) acc tl | Tezos_proxy . Proxy . Value acc ' -> ( mk_tree [... |
let test_add_leaf_get = QCheck2 . Test . make ~ name " : Tree . get ( Tree . add_leaf t k v ) k = v " ~ print : ( QCheck2 . Print . triple ( fun _ -> " < tree " ) > print_key print_raw_context ) QCheck2 . Gen . ( triple tree_gen key_gen raw_context_gen ) @@ fun ( tree , key , value ) -> let expected = Lwt_main . run @@... |
let ( ) = Alcotest . run " Proxy Getter " [ ( " Array theory " , qcheck_wrap [ test_add_leaf_get ] ) ] |
let key_gen = Gen . small_string ? gen : None |
let domain_and_requester_gen : ( string list * Test_Requester . t ) Gen . t = let open Lwt_syntax in let create sets = let requester = init_full_requester ( ) in let set_one ( key , value ) = let * _ = Test_Requester . inject requester key value in Lwt . return_unit in Lwt_main . run @@ Lwt_list . iter_s set_one sets ;... |
let requester_and_keys_gen : ( Test_Requester . t * string * string ) Gen . t = let open Gen in let * ( domain , requester ) = domain_and_requester_gen in let key_gen = let in_domain_gen = if domain = [ ] then [ ] else [ oneofl domain ] in oneof ( key_gen :: in_domain_gen ) in let * ( key1 , key2 ) = pair key_gen key_g... |
let print = Print . ( triple ( Fun . const " requester " ) string string ) |
let test_read_read_opt = Test . make ~ name " : Result . is_ok ( read t key ) = Option . is_some ( read_opt t key ) " ~ print requester_and_keys_gen @@ fun ( t , key , _ ) -> let open Lwt_syntax in let found_by_read = Lwt_main . run @@ let + r = Test_Requester . read t key in Result . is_ok r in let found_by_read_opt =... |
let test_read_opt_known = Test . make ~ name " : known t key = Option . is_some ( read_opt t key ) " ~ print requester_and_keys_gen @@ fun ( t , key , _ ) -> let open Lwt_syntax in let known = Lwt_main . run @@ Test_Requester . known t key in let found_by_read_opt = Lwt_main . run @@ let + o = Test_Requester . read_opt... |
let test_inject_read_opt = Test . make ~ name " : read_opt ( inject t key value ) = ( Some value ) " ~ print : Print . ( pair print int ) Gen . ( pair requester_and_keys_gen value_gen ) @@ fun ( ( t , key , _ ) , value ) -> let injected = Lwt_main . run @@ Test_Requester . inject t key value in assume injected ; let re... |
let test_inject_read_opt_other = Test . make ~ name " : key <> key ' ==> read_opt ( inject t key ' value ) key = read_opt t key " ~ print : Print . ( pair print int ) Gen . ( pair requester_and_keys_gen value_gen ) @@ fun ( ( t , key , key ' ) , value ) -> assume ( key <> key ' ) ; let read_opt_before = Lwt_main . run ... |
let leq_opt opt1 opt2 = match ( opt1 , opt2 ) with ( None , _ ) | ( Some _ , Some _ ) -> true | _ -> false |
let test_inject_growth = Test . make ~ name " : read_opt t key <= read_opt ( inject t key ' value ) key " ~ print : Print . ( pair print int ) Gen . ( pair requester_and_keys_gen value_gen ) @@ fun ( ( t , key , key ' ) , value ) -> let read_opt_before = Lwt_main . run @@ Test_Requester . read_opt t key in let _ = Lwt_... |
let test_inject_memory_table_length = Test . make ~ name " : memory_table_length t <= memory_table_length ( inject t key value ) " ~ print : Print . ( pair print int ) Gen . ( pair requester_and_keys_gen value_gen ) @@ fun ( ( t , key , _ ) , value ) -> let length_before = Test_Requester . memory_table_length t in let ... |
let test_clear_shrink = Test . make ~ name " : read_opt ( clear_or_cancel t key ' ) key <= read_opt t key " ~ print requester_and_keys_gen @@ fun ( t , key , key ' ) -> let read_opt_before = Lwt_main . run @@ Test_Requester . read_opt t key in Test_Requester . clear_or_cancel t key ' ; let read_opt_after = Lwt_main . r... |
let test_clear_memory_table_length = Test . make ~ name " : memory_length ( clear_or_cancel t key ' ) key <= memory_length t " ~ print requester_and_keys_gen @@ fun ( t , key , _ ) -> let length_before = Test_Requester . memory_table_length t in Test_Requester . clear_or_cancel t key ; let length_after = Test_Requester... |
let ( ) = Alcotest . run " Requester_PBT " [ ( " read " , qcheck_wrap [ test_read_read_opt ; test_read_opt_known ] ) ; ( " inject " , qcheck_wrap [ test_inject_read_opt ; test_inject_read_opt_other ; test_inject_growth ; test_inject_memory_table_length ; ] ) ; ( " clear_or_cancel " , qcheck_wrap [ test_clear_shrink ; t... |
module SeqWithBase = struct type ' a elt = ' a include Support . Lib . Seq let of_list = List . to_seq let to_list = List . of_seq let name = " Seq " let pp fmt s = Format . pp_print_list Format . pp_print_int fmt ( to_list s ) end |
module type F = functor ( S : module type of SeqWithBase ) -> sig val tests : QCheck . Test . t list end |
let wrap ( name , ( module Test : F ) ) = let module M = Test ( SeqWithBase ) in ( name , qcheck_wrap M . tests ) |
let ( ) = let name = " Test_fuzzing_seq " in let tests = [ ( " TestSeqIterfold " , ( module TestIterFold : F ) ) ] in let tests = List . map wrap tests in Alcotest . run name tests |
module type TIER = sig val suffix : string type t val of_seq : int Seq . t -> t val iter : ( int -> unit ) -> t -> ( unit , int ) result Lwt . t val iter_s : ( int -> unit Lwt . t ) -> t -> ( unit , int ) result Lwt . t val iter_e : ( int -> ( unit , int ) result ) -> t -> ( unit , int ) result Lwt . t val iter_es : ( ... |
module TieredSeq : TIER with type t = int Seq . t = struct let suffix = " XXX " include Seq type nonrec t = int t let of_seq s = s open Monad let iter f s = iter f s ; Lwt_result_syntax . return_unit let iter_s f s = Lwt_result . ok @@ iter_s f s let iter_e f s = Lwt . return @@ iter_e f s let iter_es f s = iter_es f s... |
module TestIter ( Tier : TIER ) = struct open QCheck open Monad let test_iter = Test . make ~ name ( : Format . asprintf " Seq { , _ % s } . iter " Tier . suffix ) ( triple Test_fuzzing_helpers . Fn . arith one many ) ( fun ( Fun ( _ , fn ) , init , input ) -> let open Lwt_result_syntax in eq_es ( let acc = ref init in... |
module TieredSeq_s : TIER with type t = int Seq_s . t = struct let suffix = " s " include Seq_s type nonrec t = int t let iter f s = Lwt_result . ok @@ iter f s let iter_s f s = Lwt_result . ok @@ iter_s f s end |
module TestedSeq_s = TestIter ( TieredSeq_s ) |
module TieredSeq_e : TIER with type t = ( int , int ) Seq_e . t = struct let suffix = " e " include Seq_e type nonrec t = ( int , int ) t let iter f s = Lwt . return @@ iter f s let iter_e f s = Lwt . return @@ iter_e f s end |
module TestedSeq_e = TestIter ( TieredSeq_e ) |
module TieredSeq_es : TIER with type t = ( int , int ) Seq_es . t = struct let suffix = " es " include Seq_es type nonrec t = ( int , int ) t end |
module TestedSeq_es = TestIter ( TieredSeq_es ) |
let iter_ep = let open QCheck in Test . make ~ name ( : Format . asprintf " Seq { , _s } . iter_ep " ) ( quad Test_fuzzing_helpers . Fn . arith one one many ) ( fun ( Fun ( _ , fn ) , const , init , input ) -> let open Monad . Lwt_result_syntax in eq_es ( let acc = ref init in let * ( ) = Seq . iter_ep ( IterESOf . mon... |
let iter_p = let open QCheck in Test . make ~ name ( : Format . asprintf " Seq { , _s } . iter_p " ) ( quad Test_fuzzing_helpers . Fn . arith one one many ) ( fun ( Fun ( _ , fn ) , const , init , input ) -> let open Monad . Lwt_syntax in eq_es ( let acc = ref init in let * ( ) = Seq . iter_p ( IterSOf . monotonous acc... |
let wrap ( name , ( module Tier : TIER ) ) = let module M = TestIter ( Tier ) in ( name , Lib_test . Qcheck_helpers . qcheck_wrap M . tests ) |
let ( ) = let name = " Test_fuzzing_seq_tiered " in let tests = [ ( " TestedSeq_s " , ( module TieredSeq_s : TIER ) ) ; ( " TestedSeq_e " , ( module TieredSeq_e : TIER ) ) ; ( " TestedSeq_es " , ( module TieredSeq_es : TIER ) ) ; ] in let tests = List . map wrap tests in let tests = tests @ [ ( " iter_p " , Lib_test . ... |
module IntSet : Support . Lib . Set . S with type elt = int = struct include Support . Lib . Set . Make ( Int ) end |
module SetWithBase = struct let name = " Set " type ' a elt = IntSet . elt type _alias_elt = IntSet . elt type ' a t = IntSet . t type _alias_t = IntSet . t module IntSet : Support . Lib . Set . S with type elt := _alias_elt and type t := _alias_t = struct include IntSet end include IntSet let of_list : int list -> _al... |
module type F = functor ( S : module type of SetWithBase ) -> sig val tests : QCheck . Test . t list end |
let wrap ( name , ( module Test : F ) ) = let module M = Test ( SetWithBase ) in ( name , qcheck_wrap M . tests ) |
let ( ) = let name = " Test_fuzzing_set " in let tests = [ ( " Iterp " , ( module TestIterMonotoneAgainstStdlibList : F ) ) ; ( " Fold " , ( module TestFoldMonotonicAgainstStdlibList : F ) ) ; ] in let tests = List . map wrap tests in Alcotest . run name tests |
module type Test = sig val tests : QCheck . Test . t list end |
module TestIterFold ( M : sig include Traits . BASE with type ' a elt := int include Traits . ITER_SEQUENTIAL with type ' a elt := int and type ' a t := int t include FOLDLEFT_SEQUENTIAL with type ' a elt := int and type ' a t := int t open QCheck let iter_fold_left = Test . make ~ name ( : Format . asprintf " % s . { ... |
module TestRevMapRevMap ( M : sig include BASE include Traits . MAP_PARALLEL with type ' a t := ' a t include Traits . REVMAP_PARALLEL with type ' a t := ' a t open QCheck let rev_map = Test . make ~ name ( : Format . asprintf " % s . { rev map , rev_map } " M . name ) ( triple Test_fuzzing_helpers . Fn . arith one man... |
module TestIterAgainstStdlibList ( M : sig include BASE with type ' a elt := int include Traits . ITER_SEQUENTIAL with type ' a elt := int and type ' a t := int t open QCheck let with_stdlib_iter ( fn , init , input ) = let acc = ref init in Stdlib . List . iter ( IterOf . fn acc fn ) input ; ! acc let iter = Test . ma... |
module TestIteriAgainstStdlibList ( M : sig include BASE with type ' a elt := int include Traits . ITERI_SEQUENTIAL with type ' a elt := int and type ' a t := int t open QCheck let with_stdlib_iteri ( fn , init , input ) = let acc = ref init in Stdlib . List . iteri ( IteriOf . fn acc fn ) input ; ! acc let iteri = Tes... |
module TestIterMonotoneAgainstStdlibList ( M : sig include BASE with type ' a elt := int include Traits . ITER_PARALLEL with type ' a elt := int and type ' a t := int t open QCheck let with_stdlib_iter init ( fn , const , input ) = let acc = ref init in Stdlib . List . iter ( fun elt -> acc := ! acc + MapOf . fn const ... |
module TestMapAgainstStdlibList ( M : sig include BASE include Traits . MAP_SEQUENTIAL with type ' a t := ' a t open QCheck let with_stdlib_map ( fn , const , input ) = Stdlib . List . map ( MapOf . fn const fn ) input let map = Test . make ~ name ( : Format . asprintf " % s . map , Stdlib . List . map " M . name ) ( t... |
module TestMappAgainstStdlibList ( M : sig include BASE include Traits . MAP_PARALLEL with type ' a t := ' a t open QCheck let with_stdlib_map ( fn , const , input ) = Stdlib . List . map ( MapOf . fn const fn ) input let map_p = Test . make ~ name ( : Format . asprintf " % s . map_p , Stdlib . List . map " M . name ) ... |
module TestFoldAgainstStdlibList ( M : sig include BASE with type ' a elt := int include FOLDLEFT_SEQUENTIAL with type ' a elt := int and type ' a t := int t open QCheck let with_stdlib_fold_left ( fn , init , input ) = Stdlib . List . fold_left ( FoldOf . fn fn ) init input let fold_left = Test . make ~ name ( : Forma... |
module TestFoldLeftMapAgainstStdlibList ( M : sig include BASE with type ' a elt := int include FOLDLEFTMAP_SEQUENTIAL with type ' a elt := int and type ' a t := int t open QCheck let with_stdlib_fold_left_map ( accum , init , input ) = Stdlib . List . fold_left_map ( FoldOf . fn accum ) init input let accum = fun2 Obs... |
module TestFoldMonotonicAgainstStdlibList ( M : sig include BASE with type ' a elt := int include FOLDOOO_SEQUENTIAL with type ' a elt := int and type ' a t := int t open QCheck let with_stdlib_fold_left const ( fn , init , input ) = Stdlib . List . fold_left ( fun acc x -> acc + FoldOf . fn fn const x ) init input let... |
module TestFoldRightAgainstStdlibList ( M : sig include BASE include Traits . FOLDRIGHT_SEQUENTIAL with type ' a t := ' a t open QCheck let with_stdlib_fold_right ( fn , init , input ) = Stdlib . List . fold_right ( FoldOf . fn fn ) input init let fold_right = Test . make ~ name ( : Format . asprintf " % s . fold_right... |
module TestExistForallAgainstStdlibList ( M : sig include BASE with type ' a elt := int include Traits . EXISTFORALL_PARALLEL with type ' a elt := int and type ' a t := int t open QCheck let with_stdlib_exists ( fn , const , input ) = Stdlib . List . exists ( CondOf . fn fn const ) input let exists = Test . make ~ name... |
module TestFilterAgainstStdlibList ( M : sig include BASE include Traits . FILTER_SEQUENTIAL with type ' a t := ' a t open QCheck let with_stdlib_filter ( fn , const , input ) = Stdlib . List . filter ( CondOf . fn fn const ) input let filter = Test . make ~ name ( : Format . asprintf " % s . filter , Stdlib . List . f... |
module TestFilterpAgainstStdlibList ( M : sig include BASE include Traits . FILTER_PARALLEL with type ' a t := ' a t open QCheck let with_stdlib_filter ( fn , const , input ) = Stdlib . List . filter ( CondOf . fn fn const ) input let filter_p = Test . make ~ name ( : Format . asprintf " % s . filter_p , Stdlib . List ... |
module TestFilteriAgainstStdlibList ( M : sig include BASE include Traits . FILTERI_SEQUENTIAL with type ' a t := ' a t open QCheck let with_stdlib_filteri ( fn , input ) = Stdlib . List . filteri ( CondOf . fn fn ) input let filteri = Test . make ~ name ( : Format . asprintf " % s . filteri , Stdlib . List . filteri "... |
module TestFilteripAgainstStdlibList ( M : sig include BASE include Traits . FILTERI_PARALLEL with type ' a t := ' a t open QCheck let with_stdlib_filteri ( fn , input ) = Stdlib . List . filteri ( CondOf . fn fn ) input let filteri_p = Test . make ~ name ( : Format . asprintf " % s . filteri_p , Stdlib . List . filter... |
module TestFiltermapAgainstStdlibList ( M : sig include BASE include Traits . FILTERMAP_SEQUENTIAL with type ' a t := ' a t open QCheck let with_stdlib_filter_map ( pred , arith , const , input ) = Stdlib . List . filter_map ( FilterMapOf . fns pred arith const ) input let filter_map = Test . make ~ name ( : Format . a... |
module TestFiltermappAgainstStdlibList ( M : sig include BASE include Traits . FILTERMAP_PARALLEL with type ' a t := ' a t open QCheck let with_stdlib_filter_map ( pred , arith , const , input ) = Stdlib . List . filter_map ( FilterMapOf . fns pred arith const ) input let filter_map_p = Test . make ~ name ( : Format . ... |
module TestConcatmapAgainstStdlibList ( M : sig include BASE include Traits . CONCATMAP_SEQUENTIAL with type ' a t := ' a t open QCheck let with_stdlib_concat_map ( arith , consta , constb , input ) = Stdlib . List . concat_map ( ConcatMapOf . fns Fun . id arith consta constb ) input let concat_map = Test . make ~ name... |
module TestConcatmappAgainstStdlibList ( M : sig include BASE include Traits . CONCATMAP_PARALLEL with type ' a t := ' a t open QCheck let with_stdlib_concat_map ( arith , consta , constb , input ) = Stdlib . List . concat_map ( ConcatMapOf . fns Fun . id arith consta constb ) input let concat_map_p = Test . make ~ nam... |
module TestFindStdlibList ( M : sig include BASE include Traits . FIND_SEQUENTIAL with type ' a t := ' a t open QCheck let with_stdlib_find ( pred , const , input ) = Stdlib . List . find_opt ( CondOf . fn pred const ) input let find = Test . make ~ name ( : Format . asprintf " % s . find , Stdlib . List . find_opt " M... |
module TestFindMapStdlibList ( M : sig include BASE include Traits . FINDMAP_SEQUENTIAL with type ' a t := ' a t open QCheck let with_stdlib_find_map ( fn , const , input ) = Stdlib . List . find_map ( CondMapOf . fn fn const ) input let find_map = Test . make ~ name ( : Format . asprintf " % s . find_map , Stdlib . Li... |
module TestPartitions ( M : sig include BASE include Traits . MAP_VANILLA with type ' a t := ' a t include Traits . PARTITION_EXTRAS with type ' a t := ' a t open QCheck let partition_either = Test . make ~ name ( : Format . asprintf " % s . partition , % s . partition_either " M . name M . name ) ( triple Test_fuzzing... |
module TestPartitionMap ( M : sig include BASE include Traits . PARTITIONMAP_VANILLA with type ' a t := ' a t include Traits . MAP_VANILLA with type ' a t := ' a t include Traits . PARTITION_VANILLA with type ' a t := ' a t include Traits . PARTITION_EXTRAS with type ' a t := ' a t open QCheck let mapper_of_fns pred fn... |
module TestPartitionStdlibList ( M : sig include BASE include Traits . PARTITION_PARALLEL with type ' a t := ' a t open QCheck let with_stdlib_partition ( pred , const , input ) = Stdlib . List . partition ( CondOf . fn pred const ) input let to_list_pair ( a , b ) = ( M . to_list a , M . to_list b ) let partition = Te... |
module TestFilters ( M : sig include BASE include Traits . MAP_VANILLA with type ' a t := ' a t include Traits . FILTER_EXTRAS with type ' a t := ' a t open QCheck let filter_left = Test . make ~ name ( : Format . asprintf " % s . filter , % s . filter_left " M . name M . name ) ( triple Test_fuzzing_helpers . Fn . pre... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.