diff options
Diffstat (limited to 'tests/sql_db.ml')
-rw-r--r-- | tests/sql_db.ml | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/tests/sql_db.ml b/tests/sql_db.ml index 65a93ce..ab402bc 100644 --- a/tests/sql_db.ml +++ b/tests/sql_db.ml @@ -144,7 +144,11 @@ columns = [ [ (0, Integer 2); (2, Integer 100) ]; ] ~expected: - (Ok [ [| ImportCSV.DataType.Integer 1; ImportCSV.DataType.Integer 200 |] ]) + (Ok + [ + [| ImportCSV.DataType.Integer 1; ImportCSV.DataType.Integer 100 |]; + [| ImportCSV.DataType.Integer 2; ImportCSV.DataType.Integer 200 |]; + ]) let sum_group = run_test "sum_group" @@ -213,16 +217,16 @@ columns = [ ] filters = [ - "max(:B, [:C], [:B]) = :B", + "max(:B, [], [:B]) = :B", ] |} ~input: ImportCSV.DataType. [ - [ (0, Integer 1); (1, Integer 100); (2, Integer 0) ]; - [ (0, Integer 2); (1, Integer 150); (2, Integer 0) ]; - [ (0, Integer 3); (1, Integer 200); (2, Integer 0) ]; + [ (0, Integer 1); (1, Integer 100) ]; + [ (0, Integer 2); (1, Integer 150) ]; + [ (0, Integer 3); (1, Integer 200) ]; ] ~expected:(Ok ImportCSV.DataType.[ [| Integer 3 |] ]) @@ -242,16 +246,16 @@ columns = [ filters = [ ":B <> 200", - "max(:B, [:C], [:B]) = :B", + "max(:B, [], [:B]) = :B", ] |} ~input: ImportCSV.DataType. [ - [ (0, Integer 1); (1, Integer 100); (2, Integer 0) ]; - [ (0, Integer 2); (1, Integer 150); (2, Integer 0) ]; - [ (0, Integer 3); (1, Integer 200); (2, Integer 0) ]; + [ (0, Integer 1); (1, Integer 100) ]; + [ (0, Integer 2); (1, Integer 150) ]; + [ (0, Integer 3); (1, Integer 200) ]; ] ~expected:(Ok ImportCSV.DataType.[ [| Integer 2 |] ]) @@ -270,7 +274,7 @@ columns = [ ] filters = [ - "max(:B, [:C], [:B]) = :B", + "max(:B, [], [:B]) = :B", ":B <> 200", ] @@ -278,9 +282,9 @@ filters = [ ~input: ImportCSV.DataType. [ - [ (0, Integer 1); (1, Integer 100); (2, Integer 0) ]; - [ (0, Integer 2); (1, Integer 150); (2, Integer 0) ]; - [ (0, Integer 3); (1, Integer 200); (2, Integer 0) ]; + [ (0, Integer 1); (1, Integer 100) ]; + [ (0, Integer 2); (1, Integer 150) ]; + [ (0, Integer 3); (1, Integer 200) ]; ] ~expected:(Ok []) @@ -301,17 +305,17 @@ columns = [ ] filters = [ - "max(:B, [:C], [:B]) <> :B", - "max(:B, [:C], [:B]) <> :B", + "max(:B, [], [:B]) <> :B", + "max(:B, [], [:B]) <> :B", ] |} ~input: ImportCSV.DataType. [ - [ (0, Integer 1); (1, Integer 100); (2, Integer 0) ]; - [ (0, Integer 2); (1, Integer 150); (2, Integer 0) ]; - [ (0, Integer 3); (1, Integer 200); (2, Integer 0) ]; + [ (0, Integer 1); (1, Integer 100) ]; + [ (0, Integer 2); (1, Integer 150) ]; + [ (0, Integer 3); (1, Integer 200) ]; ] ~expected:(Ok [ [| ImportCSV.DataType.Integer 1 |] ]) |