Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions lib_test/test_sanity.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ let server =
Server.respond ~status:`OK ~body:(Body.of_string "") ();
Server.respond ~status:`OK ~body:(Body.of_string_list chunk_body) ();
Server.respond ~status:`OK ~body:(Body.of_string "") ();
(* not modified *)
Server.respond ~status:`Not_modified ~body:Body.empty ()
]
|> List.map const
|> response_sequence
Expand Down Expand Up @@ -51,11 +53,16 @@ let ts =
incr counter
) resps >>= fun () ->
assert_equal ~printer:string_of_int 3 !counter;
return_unit
in
return_unit in
let not_modified_has_no_body () =
Client.get uri >>= fun (resp, body) ->
assert_equal (Response.status resp) `Not_modified;
body |> Body.is_empty >|= fun is_empty ->
assert_bool "No body returned when not modified" is_empty in
[ "sanity test", t
; "empty chunk test", empty_chunk
; "pipelined chunk test", pipelined_chunk
; "no body when response is not modified", not_modified_has_no_body
]
end

Expand Down