123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566open!ImportincludeBase.QueueincludeTest_binary_searchable.Make1_and_test(structtypenonrec'at='atletget=getletlength=lengthmoduleFor_test=structletof_arraya=letr=create()in(* We enqueue everything twice, and dequeue it once to ensure:
- that the queue has the same content as the array.
- that it has, in most cases, an interesting internal structure*)fori=0toArray.lengtha-1doenqueuera.(i)done;fori=0toArray.lengtha-1doignore(dequeue_exnr:bool);enqueuera.(i)done;r;;endend)moduleSerialization_v1=structletsexp_of_t=sexp_of_tlett_of_sexp=t_of_sexplett_sexp_grammar=t_sexp_grammarincludeBin_prot.Utils.Make_iterable_binable1(structtypenonrec'at='attype'ael='a[@@derivingbin_io]letcaller_identity=Bin_prot.Shape.Uuid.of_string"b4c84254-4992-11e6-9ba7-734e154027bd";;letmodule_name=Some"Core.Queue"letlength=lengthletiter=iterletinit~len~next=initlen~f:(fun_->next())end)letstable_witness(_:'aStable_witness.t):'atStable_witness.t=(* Serialization_v1 defines a stable serialization *)Stable_witness.assert_stable;;endincludeSerialization_v1moduleStable=structmoduleV1=structtypenonrec'at='at[@@derivingcompare,equal]includeSerialization_v1(* We don't have a [%bin_digest] expect test here because the bin_io is mostly hand
written, and [core_queue_unit_tests.ml] has unit tests for specific values. *)letmap=mapendend