summaryrefslogtreecommitdiff
path: root/test/util_test.ml
diff options
context:
space:
mode:
Diffstat (limited to 'test/util_test.ml')
-rw-r--r--test/util_test.ml7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/util_test.ml b/test/util_test.ml
index ecc4b49..3625957 100644
--- a/test/util_test.ml
+++ b/test/util_test.ml
@@ -5,11 +5,14 @@ let test_find_xml_child_existent test_ctxt =
let elem = Xml.Element ("foo", [],
[Xml.Element ("bar", [], []);
Xml.PCData "baz"])
- in assert_equal (Xml.tag (find_xml_child "bar" elem)) "bar"
+ in
+ match (find_xml_child "bar" elem) with
+ | None -> assert_failure "find_xml_child returned None"
+ | Some x -> assert_equal (Xml.tag x) "bar"
let test_find_xml_child_nonexistent test_ctxt =
let elem = Xml.Element ("foo", [], [Xml.Element ("quux", [], [])]) in
- assert_raises Not_found (fun () -> find_xml_child "bar" elem)
+ assert_equal (find_xml_child "bar" elem) None
let test_string_of_path test_ctxt =
let path = ["foo"; "bar"; "baz"] in