Skip to content

Commit c62487e

Browse files
committed
add basic test for response
1 parent a7e5097 commit c62487e

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

tests/unit/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
(tests
2-
(names t_util t_buf t_server t_io)
2+
(names t_util t_buf t_server t_io t_response)
33
(package tiny_httpd)
44
(libraries tiny_httpd.core qcheck-core qcheck-core.runner test_util))

tests/unit/t_response.ml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
open Test_util
2+
open Tiny_httpd_core
3+
module U = Util
4+
5+
let () =
6+
let res =
7+
Response.make_raw ~code:200 ~headers:[ "content-length", "42" ] ""
8+
in
9+
let h = Headers.get_exn "content-length" res.headers in
10+
assert_eq "42" h
11+
12+
let () =
13+
let res =
14+
Response.make_raw ~code:200 ~headers:[ "Content-Length", "42" ] ""
15+
in
16+
let h = Headers.get_exn "content-length" res.headers in
17+
assert_eq "42" h

0 commit comments

Comments
 (0)