text
stringlengths
12
786k
let test_failfast_loop_roles ( ) = assert_raises UnguardedLoop ~ msg " : declared roles absent in the loop " ( fun _ -> ignore @@ extract @@ loop_with [ a ; b ; c ] @@ fun t -> choice_at c [ % disj role_B ( left , right ) ] ( c , ( c --> b ) left t ) ( c , ( c -->...
let test_loop_merge ( ) = assert_raises UnguardedLoop ~ msg " : loop merge " ( fun _ -> ignore @@ extract @@ choice_at a [ % disj role_B ( left , right ) ] ( a , ( a --> b ) left @@ loop_with [ a ; b ; c ] ( fun t -> choice_at a [ % disj role_B ( left , right ) ...
let suite = " Protcol combinators fail - fast test " >::: [ " test_failfast_bottom " >:: test_failfast_bottom ; " test_failfast_loop_roles " >:: test_failfast_loop_roles ; " test_loop_merge " >:: test_loop_merge ; ] ; ;
let _results = run_test_tt_main suite in ( )
module Util = struct [ %% declare_roles a , b , c , d ] [ %% declare_labels msg , left , right , middle , ping , pong , fini ] end
let extract_b_many g = let ` cons ( _ , ` cons ( b , _ ) ) = extract g in ignore ( Mpst . Multicast . get_many b )
let test_multicast_projection_success ( ) = let finish = many_at a Mpst . BasicCombinators . finish in ignore @@ extract @@ ( a @@--> b ) left finish ; ignore @@ extract @@ choice_at b [ % disj a ( left , right ) ] ( b , ( b -->@@ a ) left finish ) ( b , ( b -->@@ a ) ...
let suite = " Protcol combinators expected " >::: [ " test_multicast_projection_success " >:: test_multicast_projection_success ; ] ; ;
let _results = run_test_tt_main suite in ( )
let test_protocol_store _ store = let open Lwt_syntax in let protocols_to_register = [ ( Tezos_embedded_protocol_alpha . Registerer . Registered . hash , Tezos_embedded_protocol_alpha . Registerer . Source . sources ) ; ( Tezos_embedded_protocol_genesis . Registerer . Registered . hash ...
let tests = let test_cases = List . map wrap_test [ ( " generic protocol storing " , test_protocol_store ) ] in ( " protocol store " , test_cases )
module Alcotest_protocol_validator = struct module type HASHEQ = sig type t val eq : t -> t -> bool val pp : Format . formatter -> t -> unit end let registered_protocol : Registered_protocol . t Alcotest . testable = let open Registered_protocol in let eq ( p1 : t ) ( p2 : t ) : bool = let (...
let section = Some ( Internal_event . Section . make_sanitized [ " node " ; " validator " ] )
let filter = Some section
let wrap f _switch ( ) = Tztest . with_empty_mock_sink ( fun _ -> Lwt_utils_unix . with_tempdir " tezos_test_ " ( fun test_dir -> init_chain test_dir >>= fun store -> init_mock_p2p Distributed_db_version . Name . zero >>= function | Ok p2p -> let db = Distributed_db . create store p2p i...
let test_pushing_validator_protocol vl _switch ( ) = let pt = Protocol . { expected_env = V0 ; components = [ ] } in Protocol_validator . validate vl Protocol_hash . zero pt >>= fun res -> Alcotest . ( check ( Tztestable . tzresults Alcotest_protocol_validator . registered_protocol ...
let test_previously_validated_protocol vl _switch ( ) = let phony_pt = Protocol . { expected_env = V0 ; components = [ ] } in Protocol_validator . validate vl genesis_protocol_hash phony_pt >>= fun res -> Alcotest . check ( Tztestable . tzresults Alcotest_protocol_validator . registered...
let test_fetching_protocol vl _switch ( ) = Protocol_validator . fetch_and_compile_protocol ~ peer : P2p_peer . Id . zero ~ timeout : Ptime . Span . zero vl Protocol_hash . zero >>= fun _ -> Mock_sink . ( assert_has_event " Should have a fetching_protocol event " ? filter Pattern . {...
let tests = [ Alcotest_lwt . test_case " pushing_validator_protocol " ` Quick ( wrap test_pushing_validator_protocol ) ; Alcotest_lwt . test_case " previously_validated_protocol " ` Quick ( wrap test_previously_validated_protocol ) ; Alcotest_lwt . test_case " fetching_protocol " ` ...
let proxy_mode_gen = QCheck2 . Gen . oneofl Tezos_proxy . Proxy . [ Client ; Server ]
let key_gen = let keys = QCheck2 . Gen . oneofl [ " big_maps " ; " index " ; " contents " ; " contracts " ; " cycle " ; " cycle " ; " rolls " ; " owner " ; " snapshot " ; " v1 " ; ] |> QCheck2 . Gen . list in QCheck2 . Gen . frequency QCheck...
let rec is_prefix t1 t2 = match ( t1 , t2 ) with | ( [ ] , _ ) -> true | ( _ , [ ] ) -> false | ( x1 :: rest1 , x2 :: rest2 ) when x1 = x2 -> is_prefix rest1 rest2 | _ -> false
let test_split_key = let fmt = let pp_sep fmt ( ) = Format . fprintf fmt " " / in Format . pp_print_list ~ pp_sep Format . pp_print_string in QCheck2 . Test . make ~ name " [ : fst ( split_key s ) ] is a prefix of [ s ] " QCheck2 . Gen . ( pair proxy_mode_gen key_gen ) ...
let ( ) = Alcotest . run " tezos - lib - client - proxy " [ ( " proxy " , Lib_test . Qcheck_helpers . qcheck_wrap [ test_split_key ] ) ]
let to_some gen = QCheck . Gen . ( gen >|= Option . some )
let rpc_addr_gen = let open QCheck . Gen in let octet = 0 -- 255 in ( fun i j k l port -> let host = Format . sprintf " % s " ( String . concat " . " @@ List . map Int . to_string [ i ; j ; k ; l ] ) in let str = Format . sprintf " http ://% s :% d " host port in Ur...
let rpc_tls_gen = let open QCheck . Gen in let path_gen = list_size ( 1 -- 8 ) ( string_size ~ gen ( : char_range ' a ' ' z ' ) ( 1 -- 8 ) ) >|= fun s -> " " / ^ String . concat " " / s in pair path_gen path_gen >|= fun ( cert , key ) -> cert ^ " , " ^ ...
let sym_block_caching_time_gen = QCheck . Gen . ( 1 -- 256 )
let proxy_server_config_arb endpoint_gen rpc_addr_gen rpc_tls_gen sym_block_caching_time_gen = let gen = QCheck . Gen . ( quad endpoint_gen rpc_addr_gen rpc_tls_gen sym_block_caching_time_gen >|= fun ( endpoint , rpc_addr , rpc_tls , sym_block_caching_time ) -> Proxy_server_config . make ~ endpoi...
module UnionRightBias = struct let arb = QCheck . Gen . ( proxy_server_config_arb ( opt @@ QCheck . gen Qcheck_helpers . endpoint_arb ) ( opt @@ QCheck . gen Qcheck_helpers . endpoint_arb ) ( opt rpc_tls_gen ) ( opt sym_block_caching_time_gen ) ) let reflexive = QCheck . Test . ...
let test_example ( ) = let fail msg_opt = let suffix = Option . fold ~ none " , : but an unknown error happened " ~ some ( : fun msg -> " , but received error : " ^ msg ) msg_opt in QCheck . Test . fail_reportf " [ example_config ] should be parseable and validated % s . " ...
let good_proxy_server_config_arb ( ? sym_block_caching_time_gen = QCheck . Gen . ( opt sym_block_caching_time_gen ) ) ( ) = proxy_server_config_arb ( to_some @@ QCheck . ( gen Qcheck_helpers . endpoint_arb ) ) ( to_some rpc_addr_gen ) QCheck . Gen . ( opt rpc_tls_gen ) sym_bl...
let test_good_arb_to_runtime_ok = QCheck . Test . make ~ name " [ : to_runtime ] returns [ Ok ] on expected values " ( good_proxy_server_config_arb ( ) ) @@ fun config -> match Proxy_server_config . to_runtime config with | Ok _ -> true | Error msg -> QCheck . Test . fail_reportf...
let test_union_preserves_to_runtime_ok = let arb = good_proxy_server_config_arb ( ) in let to_runtime_is_ok config = Proxy_server_config . to_runtime config |> Result . is_ok in QCheck . Test . make ~ name " [ : union_right_bias ] preserves [ Result . is_ok to_runtime ] " QCheck . ( ...
let test_to_runtime_err_implies_union_to_runtime_err = let url_gen = QCheck . gen Qcheck_helpers . endpoint_arb in let arb = let open QCheck . Gen in let rpc_addr_gen = oneof [ rpc_addr_gen ; url_gen ] in let rpc_tls_gen = oneof [ string ; rpc_tls_gen ] in proxy_server_config_arb ( opt url_gen ...
let test_wrong_sym_block_caching_time = let sym_block_caching_time_gen = to_some QCheck . Gen . ( neg_int ) in QCheck . Test . make ~ name " : if [ sym_block_caching_time ] is <= 0 , then [ to_runtime ] fails " ( good_proxy_server_config_arb ~ sym_block_caching_time_gen ( ) ) @...
let ( ) = Alcotest . run " Proxy_server_config " [ ( " union_right_bias " , Qcheck_helpers . qcheck_wrap UnionRightBias . [ reflexive ; right_bias ; associative ; disjoint_commutative ] ) ; ( " example " , [ Alcotest . test_case " [ example_config ] is successful...
module Setup : sig val shares : Pvss . Encrypted_share . t list val commitments : Pvss . Commitment . t list val proof : Pvss . proof val secret_scalar : Sp . Group . Scalar . t val secret : Pvss . Secret_key . t val public_secret : Pvss . Public_key . t val other_shares : Pvss . Encry...
let test_dealer_proof ( ) = let shr = ( Setup . shares , Setup . other_shares ) and cmt = ( Setup . commitments , Setup . other_commitments ) and prf = ( Setup . proof , Setup . other_proof ) in for i = 0 to 1 do for j = 0 to 1 do for k = 0 to 1 do let pick = function 0 ...
module Proof = struct module G = Sp . Group type exponent = G . Scalar . t type proof = exponent * exponent list type t = proof let encoding = Data_encoding . ( tup2 G . Scalar . encoding ( list G . Scalar . encoding ) ) let mangle : t -> t = fun ( e , es ) -> ( G . Scalar ....
let test_invalid_dealer_proof ( ) = let proof : Proof . t = Setup . convert_encoding Pvss . proof_encoding Proof . encoding Setup . proof in let mangled = Proof . mangle proof |> Setup . convert_encoding Proof . encoding Pvss . proof_encoding in assert ( not ( Pvss . check_dealer_proof ...
let test_share_reveal ( ) = let shares_valid = List . map2 ( fun ( share , ( reveal , proof ) ) public_key -> Pvss . check_revealed_share share reveal ~ public_key proof ) Setup . reveals Setup . public_keys in List . iteri ( fun i b -> print_endline ( string_of_int i ) ; asse...
module Encrypted_share = struct include Sp . Group let mangle : t -> t = fun share -> Sp . Group . ( share + share ) end
let test_invalid_share_reveal ( ) = let mangle_share : Pvss . Encrypted_share . t -> Pvss . Encrypted_share . t = fun share -> let share : Encrypted_share . t = Setup . convert_encoding Pvss . Encrypted_share . encoding Encrypted_share . encoding share in Encrypted_share . mangle share |...
let test_reconstruct ( ) = let indices = [ 0 ; 1 ; 2 ; 3 ; 4 ] in let reconstructed = Pvss . reconstruct ( List . map ( fun n -> let ( _ , ( r , _ ) ) = List . nth Setup . reveals n in r ) indices ) indices in assert ( Sp . Group . ( ( = ) ) ( Set...
let test_invalid_reconstruct ( ) = let indices = [ 0 ; 1 ; 2 ; 3 ] in let reconstructed = Pvss . reconstruct ( List . map ( fun n -> let ( _ , ( r , _ ) ) = List . nth Setup . reveals n in r ) indices ) indices in assert ( Setup . convert_encoding Pvss . Public...
let test_randomness_commitment_protocol ( ) = let threshold = 3 in let bakers = Setup . random_keypairs 30 in let endorsers = [ 0 ; 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 ] in let endorsers_public_keys = List . map ( fun endorser -> ( List . nth bakers endorser ) . S...
let tests = [ ( " pvss " , [ ( " dealer proof " , ` Quick , test_dealer_proof ) ; ( " invalid dealer proof " , ` Quick , test_invalid_dealer_proof ) ; ( " reveal " , ` Quick , test_share_reveal ) ; ( " invalid reveal " , ` Quick , test_invalid_sha...
module Interface ( R : Idl . RPC ) RPC = struct open R type exns = | Error1 of string | Error2 of ( int * bool ) bool | Error3 of ( int * bool * string ) string [ @@ deriving rpcty ] rpcty exception Calc_error of exns let errors = let open Idl . Error in { def = exns ; raiser = ( f...
module IfCode = Interface ( Codegen . Gen ( ) )
let interfaces = Codegen . Interfaces . create ~ name " : test_interface " ~ title " : Test Interface " ~ description [ : { | Test Interface for integer arithmetic } | ] ~ interfaces [ : IfCode . implementation ( ) ]
let gen_python_bindings file = let oc = open_out file in output_string oc ( Pythongen . of_interfaces interfaces |> Pythongen . string_of_ts ) string_of_ts ; close_out oc
let run_cmd msg cmd = print_endline cmd ; Alcotest ( . check int ) int msg 0 ( Sys . command cmd ) cmd
let run_linters file = run_cmd " pylint should exit with 0 " ( " pylint \ -- disable = line - too - long , too - few - public - methods , unused - argument , no - self - use , invalid - name , broad - except , protected - access , redefined - builtin , useless - object - inher...
let lint_bindings ( ) = let file = " python / bindings . py " in gen_python_bindings file ; run_linters file
let run ? input cmd = print_endline cmd ; let inp , out = Unix . open_process cmd in ( match input with | Some input -> output_string out input | None -> ( ) ) ; close_out out ; let l = input_line inp in close_in inp ; l |> String . trim
let test_commandline ( ) = gen_python_bindings " python / calc_impl / bindings . py " ; let run ? input cmd = run ? input ( " python python / calc_impl " / ^ cmd ) cmd in let n = run " Calc . add 4 5 " in Alcotest ( . check string ) string " Calc . add with parameters passed ...
let check_test_class ( ) = gen_python_bindings " python / calc_test / bindings . py " ; let run ? input cmd = run ? input ( " python python / calc_test " / ^ cmd ) cmd in run " Calc . add 4 5 " |> ignore ; run ~ input { { " :| int1 " : 3 , " int2 " : 2 } 2 } | " C...
let check_exceptions ( ) = gen_python_bindings " python / bindings . py " ; run_cmd " Exceptions should be correctly generated " " python python / exn_test . py "
let tests = [ ( " Check generated test interface bindings with pylint & pycodestyle " , ` Slow , lint_bindings ) ; " Check generated commandline bindings " , ` Slow , test_commandline ; " Check generated test class with commandline bindings " , ` Slow , check_test_class ; " Ceh...
let known_ok_tez_literals = [ ( 0L , " 0 " ) ; ( 10L , " 0 . 00001 " ) ; ( 100L , " 0 . 0001 " ) ; ( 1_000L , " 0 . 001 " ) ; ( 10_000L , " 0 . 01 " ) ; ( 100_000L , " 0 . 1 " ) ; ( 1_000_000L , " 1 " ) ; ...
let known_bad_tez_literals = [ " 10000 . " ; " 100 , . " ; " 100 , " ; " 1 , 0000 " ; " 0 . 0000 , 1 " ; " 0 . 00 , 1 " ; " 0 , 1 " ; " HAHA " ; " 0 . 000 , 000 , 1 " ; " 0 . 0000000 " ; " 9 , 999 , 999...
let fail expected given msg = Format . kasprintf Stdlib . failwith " [ @% s @ expected : % s @ got : % s ] " @ msg expected given
let fail_msg fmt = Format . kasprintf ( fail " " " " ) fmt
let default_printer _ = " "
let test_known_tez_literals ( ) = List . iter ( fun ( v , s ) -> let vv = Tez_repr . of_mutez v in let vs = Tez_repr . of_string s in let vs ' = Tez_repr . of_string ( String . concat " " ( String . split_on_char ' , ' s ) ) in let vv = match vv with None -> fail_msg "...
let test_random_tez_literals ( ) = for _ = 0 to 100_000 do let v = Random . int64 12L in let vv = Tez_repr . of_mutez v in let vv = match vv with None -> fail_msg " could not unopt % Ld " v | Some vv -> vv in let s = Tez_repr . to_string vv in let vs = Tez_repr . of_string s in let s ' ...
let tests = [ ( " tez - literals " , fun _ -> test_known_tez_literals ( ) ) ; ( " rnd - tez - literals " , fun _ -> test_random_tez_literals ( ) ) ; ]
let wrap ( n , f ) = Alcotest_lwt . test_case n ` Quick ( fun _ ( ) -> f ( ) >|= function | Ok ( ) -> ( ) | Error error -> Format . kasprintf Stdlib . failwith " % a " pp_print_trace error )
let tests = List . map wrap tests
module A = struct include Alcotest . V1 let query = testable Query . pp ( fun x y -> Query . ( equal ( normal x ) ( normal y ) ) ) let approx_query_string = let pp ppf x = Fmt . pf ppf " % S " x in let normalize = let re = Re . Pcre . regexp { ( [ |\$ 0 - 9 ] [ | A...
let random_letter ( ) = Char . chr ( Char . code ' a ' + Random . int 26 )
let rec random_query n = if n <= 1 then if Random . bool ( ) then Query . P ( Random . int 8 ) else Query . L ( String . init ( Random . int 3 ) ( fun _ -> random_letter ( ) ) ) else Query . S ( random_queries n ) if n = 0 then [ ] else if Random . bool ( ) t...
let test_show_and_hash_once ( ) = let q1 = random_query ( Random . int 8 + Random . int ( 1 lsl Random . int 8 ) ) in let q2 = random_query ( Random . int 8 + Random . int ( 1 lsl Random . int 8 ) ) in let s1 = Query . show q1 in let s2 = Query . show q2 in if Query . ...
let test_show_and_hash ( ) = try for _ = 0 to 9999 do test_show_and_hash_once ( ) done with Failure msg -> Printf . eprintf " % s \ n " msg ; exit 1
let random_query_string ( ) = let random_char _ = Char . chr ( 0x20 + Random . int 0x60 ) in String . init ( Random . int 128 ) random_char
let test_parse_special_cases ( ) = let check_reject ~ pos s = ( match Caqti_query . of_string s with | Ok _ -> A . failf " Invalid expression % S accepted by parser . " s | Error ( ` Invalid ( pos ' , msg ) ) -> if pos ' <> pos then A . failf " Position % d should be % d ...
let test_parse_random_strings ( ) = let check_normal_or_exn s = ( match Caqti_query . of_string s with | Ok q -> A . ( check approx_query_string ) " same " s ( Caqti_query . show q ) | Error ( ` Invalid ( _ , " Inconsistent parameter style . " ) ) -> ( ) | Error ( ...
let test_expand ( ) = let env1 = function | " " -> Caqti_query . L " default " | " alt " -> Caqti_query . L " other " | _ -> raise Not_found in let env2 = function | " . " -> Caqti_query . L " default . " | " alt . " -> Caqti_query . L " other . " | _ ...
let test_cases = [ A . test_case " show , hash " ` Quick test_show_and_hash ; A . test_case " parse special cases " ` Quick test_parse_special_cases ; A . test_case " parse random strings " ` Quick test_parse_random_strings ; A . test_case " expand " ` Quick test_expand ; ] ...
module U = struct let string_of_list f l = " [ " ^ List . fold_left ( fun a b -> a ^ f b ^ " ; " ) " " l ^ " ] " let print_header h = Printf . printf " % s " ( " \ n " ^ h ^ " \ n " ) end
module IntAtom = struct type t = int let compare = Pervasives . compare let resolve x y = ' ' # let merge3 ~ ancestor x y = ' ' # let to_string = string_of_int end
let _ = U . print_header " Queue " ; let module M = Queue_imp . Make ( IntAtom ) in let a = M . empty |> M . add 4 |> M . add 3 |> M . add 2 |> M . add 1 in let b = M . empty |> M . add 4 |> M . add 1 in M . iter ( fun x -> print_string " " | ; print_int x ; ...
let _ = U . print_header " Queue1 " ; let module M = Queue_imp . Make ( IntAtom ) in let original = M . empty in let q1 = original |> M . add 5 in let q2 = original |> M . add 5 |> M . add 6 in let edit_seq_printer = U . string_of_list ( M . edit_to_string IntAtom . to_string ...
let _ = U . print_header " Queue2 " ; let module M = Queue_imp . Make ( IntAtom ) in let original = M . empty in let q1 = M . empty in let q2 = M . empty |> M . add 1 |> M . add 2 |> M . add 3 |> M . add 4 |> M . add 5 in let edit_seq_printer = U . string_of_list ( M ....
let _ = U . print_header " Queue3 " ; let module M = Queue_imp . Make ( IntAtom ) in let original = M . empty |> M . add 1 |> M . add 2 in let q1 = M . empty in let q2 = M . empty |> M . add 2 in let edit_seq_printer = U . string_of_list ( M . edit_to_string IntAtom . to_s...
let _ = U . print_header " Queue4 " ; let module M = Queue_imp . Make ( IntAtom ) in let original = M . empty in let q1 = original |> M . add 1 |> M . add 2 |> M . add 3 |> M . add 4 in let q2 = original |> M . add 1 |> M . add 2 |> M . add 3 |> M . add 5 in let edi...
let _ = U . print_header " Queue5 " ; let module M = Queue_imp . Make ( IntAtom ) in let original = M . empty |> M . add 1 |> M . add 2 |> M . add 3 |> M . add 4 in let q1 = M . empty |> M . add 1 |> M . add 2 |> M . add 3 |> M . add 5 in let q2 = M . empty |> ...
let _ = U . print_header " Queue6 " ; let module M = Queue_imp . Make ( IntAtom ) in let original = M . empty in let q1 = M . empty |> M . add 1 |> M . add 2 |> M . add 3 in let q2 = M . empty |> M . add 4 |> M . add 5 |> M . add 6 in let edit_seq_printer = U . strin...
let _ = U . print_header " Queue7 " ; let module M = Queue_imp . Make ( IntAtom ) in let original = M . empty in let q1 = M . empty |> M . add 1 |> M . add 2 in let q2 = M . empty |> M . add 1 |> M . add 2 in let edit_seq_printer = U . string_of_list ( M . edit_to_string...
let _ = U . print_header " Queue8 " ; let module M = Queue_imp . Make ( IntAtom ) in let original = M . empty |> M . add 1 |> M . add 2 in let q1 = M . empty |> M . add 1 |> M . add 2 |> M . add 3 in let q2 = M . empty |> M . add 2 in let edit_seq_printer = U . strin...
let _ = U . print_header " Queue9 " ; let module M = Queue_imp . Make ( IntAtom ) in let original = M . empty |> M . add 1 |> M . add 2 in let q1 = M . empty |> M . add 2 in let q2 = M . empty |> M . add 1 |> M . add 2 |> M . add 3 in let edit_seq_printer = U . strin...
let _ = U . print_header " Queue10 " ; let module M = Queue_imp . Make ( IntAtom ) in let original = M . empty |> M . add 1 |> M . add 2 in let q1 = M . empty in let q2 = M . empty |> M . add 1 in let edit_seq_printer = U . string_of_list ( M . edit_to_string IntAtom . to_...
let _ = U . print_header " Queue11 " ; let module M = Queue_imp . Make ( IntAtom ) in let original = M . empty |> M . add 1 |> M . add 2 in let q1 = M . empty |> M . add 1 in let q2 = M . empty |> M . add 2 |> M . add 1 |> M . add 3 in let edit_seq_printer = U . stri...
let _ = U . print_header " Queue12 " ; let module M = Queue_imp . Make ( IntAtom ) in let original = M . empty |> M . add 1 |> M . add 2 |> M . add 3 in let q1 = M . empty |> M . add 5 in let q2 = M . empty in let edit_seq_printer = U . string_of_list ( M . edit_to_strin...
let _ = U . print_header " Queue13 " ; let module M = Queue_imp . Make ( IntAtom ) in let original = M . empty |> M . add 1 |> M . add 2 |> M . add 3 in let q1 = M . empty |> M . add 1 |> M . add 5 in let q2 = M . empty |> M . add 1 |> M . add 2 |> M . add 3 in ...
let _ = U . print_header " Queue14 " ; let module M = Queue_imp . Make ( IntAtom ) in let original = M . empty |> M . add 1 in let q1 = M . empty |> M . add 2 |> M . add 3 |> M . add 4 in let q2 = M . empty |> M . add 1 |> M . add 5 |> M . add 6 in let edit_seq_prin...
let _ = U . print_header " Queue15 " ; let module M = Queue_imp . Make ( IntAtom ) in let original = M . empty |> M . add 1 in let q1 = M . empty |> M . add 1 |> M . add 2 |> M . add 3 in let q2 = M . empty |> M . add 2 |> M . add 3 |> M . add 4 in let edit_seq_prin...
let _ = U . print_header " Queue16 " ; let module M = Queue_imp . Make ( IntAtom ) in let original = M . empty |> M . add 1 |> M . add 2 |> M . add 3 in let q1 = M . empty |> M . add 1 |> M . add 2 in let q2 = M . empty |> M . add 1 |> M . add 3 in let edit_seq_prin...
let _ = U . print_header " Queue17 " ; let module M = Queue_imp . Make ( IntAtom ) in let original = M . empty |> M . add 2 in let q1 = M . empty |> M . add 7 |> M . add 3 |> M . add 1 in let q2 = M . empty |> M . add 2 |> M . add 3 |> M . add 5 in let edit_seq_prin...