diff --git a/ocaml/evaluate.ml b/ocaml/evaluate.ml index 4625735..b9e64a4 100644 --- a/ocaml/evaluate.ml +++ b/ocaml/evaluate.ml @@ -25,11 +25,9 @@ let remove_spaces str = let evaluate str = match str with | str when is_url str -> - begin - let title = SimpleHttp.get_http_title (SimpleHttp.get_body str) |> remove_spaces in - match title with - | Some t -> Some ("[ " ^ t ^ " ]") - | None -> None - end + (let title = SimpleHttp.get_http_title (SimpleHttp.get_body str) |> remove_spaces in + match title with + | Some t -> Some ("[ " ^ t ^ " ]") + | None -> None) | "o/" -> Some "o/" | _ -> None diff --git a/ocaml/test.ml b/ocaml/test.ml index 91ffef3..4ec4b66 100644 --- a/ocaml/test.ml +++ b/ocaml/test.ml @@ -22,8 +22,8 @@ let test_remove_spaces test_ctxt = foo bar baz " in - let cleaned_str = Evaluate.remove_spaces str in - assert_equal "foo bar baz" cleaned_str + let cleaned_str = Evaluate.remove_spaces (Some str) in + assert_equal (Some "foo bar baz") cleaned_str (* Name the test cases and group them together *)