Created
April 13, 2018 07:10
-
-
Save Bloofer/037680707792be9236bb1074e7f0fb92 to your computer and use it in GitHub Desktop.
expect test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let%expect_test _ = | |
let test l = | |
let stringify l = List.map ~f:Int.to_string |> String.concat ~sep:"-" in | |
List.group l ~break:(fun x y -> y < x) | |
|> List.iter ~f:(fun sub -> print_endline (stringify sub)) | |
in | |
test [1;2;3;2;3;3;6;1;2;36;7]; | |
[%expect {| | |
1-2-3 | |
2-3-3-6 | |
1-2-36 | |
7 | |
|}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment