OSDN Git Service

Add UnitTest for Base module
authormzp <mzpppp@gmail.com>
Sat, 1 Nov 2008 01:46:55 +0000 (10:46 +0900)
committermzp <mzpppp@gmail.com>
Sat, 1 Nov 2008 01:46:55 +0000 (10:46 +0900)
- add test for 'group_by'

test/test_base.ml

index 2e2f3fe..07b1478 100644 (file)
@@ -32,3 +32,7 @@ test either =
 test map_accum_left =
     assert_equal (0, []) @@ map_accum_left (fun i x->(i+1,x+i)) 0 [];
     assert_equal (4, [1; 2; 3; 4]) @@ map_accum_left (fun i x->(i+1,x+i)) 0 [1;1;1;1]
+
+test group_by =
+    assert_equal [[1];[2;2];[3]] @@ group_by (==) [1;2;2;3]
+