From 7a9a741bb0f088d45310fe99417d641e9a2b52f5 Mon Sep 17 00:00:00 2001 From: Bikal Gurung Date: Wed, 28 Jun 2017 23:27:06 +0100 Subject: [PATCH] Adds tests for split function. --- src/core/CCList.ml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/core/CCList.ml b/src/core/CCList.ml index 9830afd4..0d79a23b 100644 --- a/src/core/CCList.ml +++ b/src/core/CCList.ml @@ -1393,3 +1393,18 @@ let split l = in direct direct_depth_default_ l +(*$Q + (Q.(list (pair int string))) (fun l -> \ + let (l1, l2) = split l in \ + List.length l1 = List.length l \ + && List.length l2 = List.length l) + + (Q.(list (pair string int))) (fun l -> \ + let l = ("hello", 10) :: l in \ + let (l1, l2) = split l in \ + let i = Random.int @@ List.length l in \ + let l1_x = List.nth l1 i in \ + let l2_y = List.nth l2 i in \ + let (x,y) = List.nth l i in \ + l1_x = x && l2_y = y) +*)