(** The list helpers in {!Ogit.List_ext}. *) let list_int = Alcotest.(list int) let test_take () = Alcotest.check list_int "take 0" [] (Ogit.List_ext.take 0 [ 1; 2; 3 ]); Alcotest.check list_int "take 2" [ 1; 2 ] (Ogit.List_ext.take 2 [ 1; 2; 3 ]); Alcotest.check list_int "take all" [ 1; 2; 3 ] (Ogit.List_ext.take 3 [ 1; 2; 3 ]); Alcotest.check list_int "take beyond" [ 1; 2; 3 ] (Ogit.List_ext.take 5 [ 1; 2; 3 ]); Alcotest.check list_int "take from empty" [] (Ogit.List_ext.take 3 []); Alcotest.check list_int "take negative" [] (Ogit.List_ext.take (-1) [ 1; 2 ]) let test_drop () = Alcotest.check list_int "drop 0" [ 1; 2; 3 ] (Ogit.List_ext.drop 0 [ 1; 2; 3 ]); Alcotest.check list_int "drop 2" [ 3 ] (Ogit.List_ext.drop 2 [ 1; 2; 3 ]); Alcotest.check list_int "drop all" [] (Ogit.List_ext.drop 3 [ 1; 2; 3 ]); Alcotest.check list_int "drop beyond" [] (Ogit.List_ext.drop 5 [ 1; 2; 3 ]); Alcotest.check list_int "drop from empty" [] (Ogit.List_ext.drop 3 []); Alcotest.check list_int "drop negative" [ 1; 2 ] (Ogit.List_ext.drop (-1) [ 1; 2 ]) let suite = ( "list_ext", [ Alcotest.test_case "take" `Quick test_take; Alcotest.test_case "drop" `Quick test_drop; ] )