From a193c540811660473c7cd0b15e632fa0a42d022c Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Sun, 19 Oct 2014 20:50:02 +0200 Subject: [PATCH] added a regression test --- tests/test_sequence.ml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/test_sequence.ml b/tests/test_sequence.ml index 1b6c862..549fc85 100644 --- a/tests/test_sequence.ml +++ b/tests/test_sequence.ml @@ -6,7 +6,8 @@ open Sequence.Infix let pp_ilist l = let b = Buffer.create 15 in - Format.bprintf b "@[%a@]" (S.pp_seq Format.pp_print_int) (S.of_list l); + let fmt = Format.formatter_of_buffer b in + Format.fprintf fmt "@[%a@]" (S.pp_seq Format.pp_print_int) (S.of_list l); Buffer.contents b let test_empty () = @@ -197,6 +198,11 @@ let test_take () = OUnit.assert_equal ~printer:pp_ilist [1;2;3;4;5] l; () +let test_regression1 () = + let s = S.(take 10 (repeat 1)) in + OUnit.assert_bool "not empty" (not (S.is_empty s)); + () + let suite = "test_sequence" >::: [ "test_empty" >:: test_empty; @@ -225,4 +231,5 @@ let suite = "test_hashtbl" >:: test_hashtbl; "test_int_range" >:: test_int_range; "test_take" >:: test_take; + "test_regression1" >:: test_regression1 ]