summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2015-09-21 08:50:17 +0600
committerDaniil Baturin <daniil@baturin.org>2015-09-21 08:50:17 +0600
commit3d734a5a5f97830acc6f722de75f04edbc81d285 (patch)
treecb8b110307c2d01609c82e2dfe06fd8a398542c2 /test
parent858763ff82cec2c67864a027aac6d689b2706914 (diff)
downloadvyconf-3d734a5a5f97830acc6f722de75f04edbc81d285.tar.gz
vyconf-3d734a5a5f97830acc6f722de75f04edbc81d285.zip
Update tests for the Vylist API change.
Diffstat (limited to 'test')
-rw-r--r--test/vylist_test.ml6
-rw-r--r--test/vytree_load_test.ml7
2 files changed, 4 insertions, 9 deletions
diff --git a/test/vylist_test.ml b/test/vylist_test.ml
index 8cd504b..b20282d 100644
--- a/test/vylist_test.ml
+++ b/test/vylist_test.ml
@@ -44,16 +44,16 @@ let test_insert_before_nonexistent test_ctxt =
(* complement returns correct result when one list contains another, in any order *)
let test_complement_first_is_longer test_ctxt =
let xs = [1;2;3;4;5] and ys = [1;2;3] in
- assert_equal (complement xs ys) (Some [4;5])
+ assert_equal (complement xs ys) [4;5]
let test_complement_second_is_longer test_ctxt =
let xs = [1;2] and ys = [1;2;3;4;5] in
- assert_equal (complement xs ys) (Some [3;4;5])
+ assert_equal (complement xs ys) [3;4;5]
(* complement returns None if one list doesn't contain another *)
let test_complement_doesnt_contain test_ctxt =
let xs = [1;2;3] and ys = [1;4;5;6] in
- assert_equal (complement xs ys) None
+ assert_equal (complement xs ys) []
(* in_list works *)
let test_in_list test_ctxt =
diff --git a/test/vytree_load_test.ml b/test/vytree_load_test.ml
index ce85459..b56e130 100644
--- a/test/vytree_load_test.ml
+++ b/test/vytree_load_test.ml
@@ -9,11 +9,6 @@ let max_children = 1000
(* Number of paths *)
let max_paths = 1000
-let val_of x =
- match x with
- | Some x -> x
- | None -> failwith "No value here"
-
let insert_full tree path data =
let rec aux tree path basepath data =
match path with
@@ -24,7 +19,7 @@ let insert_full tree path data =
aux tree ps basepath data
in
let existent_path = Vytree.get_existent_path tree path in
- let rest = val_of @@ Vylist.complement path existent_path in
+ let rest = Vylist.complement path existent_path in
aux tree rest existent_path ()
let rec add_many_children t n basepath data =