chore: upgrade qcheck to 0.91, fix deprecation warnings

- small_list -> list_small
- bytes_of_size -> bytes_size
- small_nat -> nat_small
- prefix unused Frame_type constants with underscore
This commit is contained in:
Simon Cruanes 2026-02-15 20:50:43 +00:00
parent 6c3e705df5
commit 97c4e4dc08
5 changed files with 11 additions and 11 deletions

View file

@ -28,7 +28,7 @@
(logs :with-test) (logs :with-test)
(conf-libcurl :with-test) (conf-libcurl :with-test)
(ptime :with-test) (ptime :with-test)
(qcheck-core (and (>= 0.9) :with-test)))) (qcheck-core (and (>= 0.91) :with-test))))
(package (package
(name tiny_httpd_camlzip) (name tiny_httpd_camlzip)

View file

@ -26,11 +26,11 @@ type handler = unit Request.t -> IO.Input.t -> IO.Output.t -> unit
module Frame_type = struct module Frame_type = struct
type t = int type t = int
let continuation : t = 0 let _continuation : t = 0
let text : t = 1 let _text : t = 1
let binary : t = 2 let binary : t = 2
let close : t = 8 let _close : t = 8
let ping : t = 9 let _ping : t = 9
let pong : t = 10 let pong : t = 10
let show = function let show = function
@ -132,7 +132,7 @@ module Writer = struct
() ()
(** Max fragment size: send 16 kB at a time *) (** Max fragment size: send 16 kB at a time *)
let max_fragment_size = 16 * 1024 let _max_fragment_size = 16 * 1024
let[@inline never] really_output_buf_ (self : t) = let[@inline never] really_output_buf_ (self : t) =
self.header.fin <- true; self.header.fin <- true;

View file

@ -40,7 +40,7 @@ let () = assert_eq (Ok [ "foo", "bar" ]) (U.parse_query "yolo#foo=bar")
let () = let () =
add_qcheck add_qcheck
@@ QCheck.Test.make ~name:__LOC__ ~long_factor:20 ~count:1_000 @@ QCheck.Test.make ~name:__LOC__ ~long_factor:20 ~count:1_000
Q.(small_list (pair string string)) Q.(list_small (pair string string))
(fun l -> (fun l ->
List.iter List.iter
(fun (a, b) -> (fun (a, b) ->

View file

@ -14,9 +14,9 @@ let () =
@@ QCheck.Test.make ~count:10_000 @@ QCheck.Test.make ~count:10_000
Q.( Q.(
triple triple
(bytes_of_size (Gen.return 4)) (bytes_size (Gen.return 4))
(option small_nat) (option nat_small)
(bytes_of_size Gen.(0 -- 6000)) (bytes_size Gen.(0 -- 6000))
(* |> Q.add_stat ("b.size", fun (_k, b) -> Bytes.length b) *) (* |> Q.add_stat ("b.size", fun (_k, b) -> Bytes.length b) *)
|> Q.add_shrink_invariant (fun (k, _, _) -> Bytes.length k = 4)) |> Q.add_shrink_invariant (fun (k, _, _) -> Bytes.length k = 4))
(fun (key, mask_offset, b) -> (fun (key, mask_offset, b) ->

View file

@ -22,7 +22,7 @@ depends: [
"logs" {with-test} "logs" {with-test}
"conf-libcurl" {with-test} "conf-libcurl" {with-test}
"ptime" {with-test} "ptime" {with-test}
"qcheck-core" {>= "0.9" & with-test} "qcheck-core" {>= "0.91" & with-test}
] ]
depopts: [ depopts: [
"logs" "logs"