diff --git a/Changes.md b/Changes.md index 155c33f..186ca01 100644 --- a/Changes.md +++ b/Changes.md @@ -1,5 +1,9 @@ CFStream Release Notes +cfstream-1.1.2 2014-06-16 +------------------------- +* Reduced deps to core_kernel instead of core. + cfstream-1.1.1 2014-03-02 ------------------------- * Fix doc build bug. diff --git a/OMakeroot b/OMakeroot index 317e050..009b4bb 100644 --- a/OMakeroot +++ b/OMakeroot @@ -25,7 +25,7 @@ LIB_MODULES[] = CFStream_streamable CFStream_stream CFStream -LIB_PACKAGES = core +LIB_PACKAGES = core_kernel TEST_NAME = $(PROJECT)-test TEST_MODULES[] = $(removesuffix $(basename $(ls src/test/test_*.ml))) diff --git a/bin/travis.sh b/bin/travis.sh index 43ae13d..48ebeb7 100644 --- a/bin/travis.sh +++ b/bin/travis.sh @@ -17,7 +17,7 @@ opam --git-version # install OCaml packages opam init eval `opam config env` -opam install ocamlfind omake core +opam install ocamlfind omake core_kernel # test this package omake diff --git a/etc/opam/packages/cfstream.master/opam b/etc/opam/packages/cfstream.master/opam index 7e33c78..106e67b 100644 --- a/etc/opam/packages/cfstream.master/opam +++ b/etc/opam/packages/cfstream.master/opam @@ -18,7 +18,7 @@ build-doc: [ depends: [ "ocamlfind" "omake" - "core" + "core_kernel" ] ocaml-version: [>="4.00.1"] diff --git a/src/lib/CFStream_stream.ml b/src/lib/CFStream_stream.ml index 05a366f..d02613c 100644 --- a/src/lib/CFStream_stream.ml +++ b/src/lib/CFStream_stream.ml @@ -1,4 +1,4 @@ -open Core.Std +open Core_kernel.Std include Stream let next_exn = next diff --git a/src/lib/CFStream_stream.mli b/src/lib/CFStream_stream.mli index 95bc15b..c91114b 100644 --- a/src/lib/CFStream_stream.mli +++ b/src/lib/CFStream_stream.mli @@ -3,7 +3,7 @@ In general, functions that return a stream return a "fresh" stream, meaning that their count is set to 0. *) -open Core.Std +open Core_kernel.Std (** Type of streams holding values of type ['a]. *) type 'a t = 'a Stream.t @@ -362,7 +362,7 @@ val of_string : string -> char t (** Convert exception-less stream to exception-ful stream. Resulting stream raises exception at first error seen. *) val result_to_exn : - ('output, 'error) Core.Std.Result.t t -> + ('output, 'error) Result.t t -> error_to_exn:('error -> exn) -> 'output t diff --git a/src/test/test_stream.ml b/src/test/test_stream.ml index ca48fff..e4598d7 100644 --- a/src/test/test_stream.ml +++ b/src/test/test_stream.ml @@ -1,4 +1,4 @@ -open Core.Std +open Core_kernel.Std open OUnit open CFStream_stream open CFStream_stream.Infix @@ -18,7 +18,7 @@ let test_exists () = let test_group () = let f x = x mod 2 in - let groups = + let groups = [ 1 ; 3 ; 4 ; 5 ; 4 ; 2 ; 9] |! of_list |! group ~f @@ -29,7 +29,7 @@ let test_group () = (* now the same test but visiting the groups in the reverse order (triggers forcing of previous streams) *) - let groups = + let groups = [ 1 ; 3 ; 4 ; 5 ; 4 ; 2 ; 9] |! of_list |! group ~f @@ -37,7 +37,7 @@ let test_group () = |! List.rev_map ~f:to_list |! List.rev in - assert_equal + assert_equal ~msg:"Find groups with same parity (reverse order)" groups [ [ 1 ; 3 ] ; [ 4 ] ; [ 5 ] ; [ 4 ; 2 ] ; [ 9 ] ] @@ -49,7 +49,7 @@ let test_concat () = |! group ~f |! concat |! to_list - in + in assert_equal ~msg:"Concat grouped enum is idempotent" l m @@ -68,7 +68,7 @@ let test_uncombine () = assert_equal ~printer:int_list_printer ~msg:"Check first list" (List.rev l1) [ 1 ; 3 ; 5 ; 7 ] ; assert_equal ~printer:int_list_printer ~msg:"Check second list" (List.rev l2) [ 2 ; 4 ; 6 ; 8 ] -let test_partition () = +let test_partition () = let f x = x mod 2 = 0 in let l = List.init 100 ~f:(fun _ -> Random.int 10) in let r1 = Caml.List.partition f l in @@ -76,7 +76,7 @@ let test_partition () = of_list l |! partition ~f |! (fun (a, b) -> (to_list a, to_list b)) - in + in assert_equal ~printer:int_list_tuple_printer ~msg:"Check stream partition against list partition" @@ -87,19 +87,19 @@ let test_iter () = let c = ref [] in let f x = c := x :: !c in iter (Stream.of_list l) ~f ; - assert_equal + assert_equal ~printer:int_list_printer ~msg:"Check list built with iter" l (List.rev !c) let test_take () = - assert_equal + assert_equal ~printer:int_list_printer ~msg:"Check take" [1;2;3] (to_list (take (of_list [1;2;3;4;5]) 3)) ; let s = of_list [1;2;3;4;5] in ignore (next s) ; - assert_equal + assert_equal ~printer:int_list_printer ~msg:"Check take after changing the stream count" [2;3;4] (to_list (take s 3)) @@ -170,7 +170,7 @@ let test_skip () = ~msg:"Check [skip]'ed lists (by hand and by [uniq]" [ 6;-1;-2;7;8 ] ([ -5 ; -5 ; -6 ;6;-1;-2;7;8 ] |! of_list |! skip_while ~f:(( > ) 0) |! to_list) - + let tests = "Stream" >::: [ "Exists" >:: test_exists;