From 97c4e4dc08d4465ea7d7e57364daae780c07140d Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Sun, 15 Feb 2026 20:50:43 +0000 Subject: [PATCH] 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 --- dune-project | 2 +- src/ws/tiny_httpd_ws.ml | 10 +++++----- tests/unit/t_util.ml | 2 +- tests/unit/ws/t_ws_q.ml | 6 +++--- tiny_httpd.opam | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dune-project b/dune-project index fc741051..c05a4cca 100644 --- a/dune-project +++ b/dune-project @@ -28,7 +28,7 @@ (logs :with-test) (conf-libcurl :with-test) (ptime :with-test) - (qcheck-core (and (>= 0.9) :with-test)))) + (qcheck-core (and (>= 0.91) :with-test)))) (package (name tiny_httpd_camlzip) diff --git a/src/ws/tiny_httpd_ws.ml b/src/ws/tiny_httpd_ws.ml index 3c4fdf03..4979549d 100644 --- a/src/ws/tiny_httpd_ws.ml +++ b/src/ws/tiny_httpd_ws.ml @@ -26,11 +26,11 @@ type handler = unit Request.t -> IO.Input.t -> IO.Output.t -> unit module Frame_type = struct type t = int - let continuation : t = 0 - let text : t = 1 + let _continuation : t = 0 + let _text : t = 1 let binary : t = 2 - let close : t = 8 - let ping : t = 9 + let _close : t = 8 + let _ping : t = 9 let pong : t = 10 let show = function @@ -132,7 +132,7 @@ module Writer = struct () (** 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) = self.header.fin <- true; diff --git a/tests/unit/t_util.ml b/tests/unit/t_util.ml index 7af8b87e..b3a2e066 100644 --- a/tests/unit/t_util.ml +++ b/tests/unit/t_util.ml @@ -40,7 +40,7 @@ let () = assert_eq (Ok [ "foo", "bar" ]) (U.parse_query "yolo#foo=bar") let () = add_qcheck @@ 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 -> List.iter (fun (a, b) -> diff --git a/tests/unit/ws/t_ws_q.ml b/tests/unit/ws/t_ws_q.ml index 1e17cb50..1776fd02 100644 --- a/tests/unit/ws/t_ws_q.ml +++ b/tests/unit/ws/t_ws_q.ml @@ -14,9 +14,9 @@ let () = @@ QCheck.Test.make ~count:10_000 Q.( triple - (bytes_of_size (Gen.return 4)) - (option small_nat) - (bytes_of_size Gen.(0 -- 6000)) + (bytes_size (Gen.return 4)) + (option nat_small) + (bytes_size Gen.(0 -- 6000)) (* |> Q.add_stat ("b.size", fun (_k, b) -> Bytes.length b) *) |> Q.add_shrink_invariant (fun (k, _, _) -> Bytes.length k = 4)) (fun (key, mask_offset, b) -> diff --git a/tiny_httpd.opam b/tiny_httpd.opam index e4048cb7..7fbbe020 100644 --- a/tiny_httpd.opam +++ b/tiny_httpd.opam @@ -22,7 +22,7 @@ depends: [ "logs" {with-test} "conf-libcurl" {with-test} "ptime" {with-test} - "qcheck-core" {>= "0.9" & with-test} + "qcheck-core" {>= "0.91" & with-test} ] depopts: [ "logs"