From 5b790d3f09668b51190ff97962ae2f20112008e7 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Mon, 3 Mar 2014 23:33:47 +0100 Subject: [PATCH] Add unit test for HTML title. --- ocaml/_tags | 1 + ocaml/test.ml | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 ocaml/test.ml diff --git a/ocaml/_tags b/ocaml/_tags index 87ab315..1e23598 100644 --- a/ocaml/_tags +++ b/ocaml/_tags @@ -1 +1,2 @@ true: package(ssl,netclient,netstring,equeue-ssl) +: package(oUnit) diff --git a/ocaml/test.ml b/ocaml/test.ml new file mode 100644 index 0000000..d817e86 --- /dev/null +++ b/ocaml/test.ml @@ -0,0 +1,25 @@ +open OUnit2 + + +let test_get_title test_ctxt = + let body = " + + + + Fabien + + +

Header

+ +" in + let title = SimpleHttp.get_http_title body in + assert_equal (Some "Fabien") title + + +(* Name the test cases and group them together *) +let suite = +"suite">::: + ["test get_title">:: test_get_title] + +let () = + run_test_tt_main suite