details for logs

This commit is contained in:
Simon Cruanes 2024-02-26 22:54:45 -05:00
parent 950f0e734f
commit 6cfd1975d1
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
3 changed files with 10 additions and 6 deletions

View file

@ -19,10 +19,10 @@ let () =
match r with
| None -> failwith "should parse"
| Some req ->
assert_eq (Some "coucou") (Headers.get "Host" req.Request.headers);
assert_eq (Some "coucou") (Headers.get "host" req.Request.headers);
assert_eq (Some "11") (Headers.get "content-length" req.Request.headers);
assert_eq "hello" req.Request.path;
assert_eq (Some "coucou") (Headers.get "Host" req.headers);
assert_eq (Some "coucou") (Headers.get "host" req.headers);
assert_eq (Some "11") (Headers.get "content-length" req.headers);
assert_eq "hello" req.path;
let req = Request.Private_.parse_body req str |> Request.read_body_full in
assert_eq ~to_string:(fun s -> s) "salutations" req.Request.body;
assert_eq ~to_string:(fun s -> s) "salutations" req.body;
()

View file

@ -2,4 +2,4 @@
(library
(name test_util)
(modules test_util)
(libraries qcheck-core qcheck-core.runner))
(libraries logs qcheck-core qcheck-core.runner))

View file

@ -29,3 +29,7 @@ let add_qcheck f = qchecks := f :: !qchecks
let run_qcheck_and_exit () : 'a =
exit @@ QCheck_base_runner.run_tests ~colors:false !qchecks
let setup_logs_debug () =
Logs.set_reporter @@ Logs.format_reporter ();
Logs.set_level ~all:true @@ Some Logs.Debug