From 60cc099df46e1cbcb7b37be3fe455978f800887f Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Wed, 23 Oct 2024 18:50:46 -0500 Subject: T6718: update tests Update tests, as appropriate: for example, the Vyconf config file grammar is distinct from the one currently used in vyos1x-config, consequently the curly_parser_test is not included. --- test/util_test.ml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'test/util_test.ml') diff --git a/test/util_test.ml b/test/util_test.ml index 2f5bf5d..5e348fc 100644 --- a/test/util_test.ml +++ b/test/util_test.ml @@ -1,22 +1,26 @@ +[@@@ocaml.warning "-27"] + open OUnit2 -open Util + +module RT = Vyos1x.Reference_tree +module U = Vyos1x.Util let test_find_xml_child_existent test_ctxt = let elem = Xml.Element ("foo", [], [Xml.Element ("bar", [], []); Xml.PCData "baz"]) in - match (find_xml_child "bar" elem) with + match (RT.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_equal (find_xml_child "bar" elem) None + assert_equal (RT.find_xml_child "bar" elem) None let test_string_of_list test_ctxt = let path = ["foo"; "bar"; "baz"] in - assert_equal (String.trim (string_of_list path)) "foo bar baz" + assert_equal (String.trim (U.string_of_list path)) "foo bar baz" let suite = "Util tests" >::: [ -- cgit v1.2.3