1import ProjectM36.Client
2import ProjectM36.DataFrame
3import TutorialD.Interpreter.TestBase
7import qualified Data.Set as S
10testList = TestList [testOrderBy, testLimit, testOffset]
14 tcounts <- runTestTT testList
15 if errors tcounts + failures tcounts > 0 then exitFailure else exitSuccess
18testOrderBy = TestCase $ do
19 (sessionId, dbconn) <- dateExamplesConnection emptyNotificationCallback
20 Right df <- executeDataFrameExpr sessionId dbconn (
22 convertExpr = Project (AttributeNames (S.singleton "status")) (RelationVariable "s" ()),
23 orderExprs = [AttributeOrderExpr "status" AscendingOrder],
27 let vals = map (\tup -> case atomForAttributeName "status" tup of
28 Left err -> error (show err)
29 Right atom -> atom) (tuples df)
30 assertEqual "sort order of s" [IntegerAtom 10, IntegerAtom 20, IntegerAtom 30] vals
33testOffset = TestCase $ do
34 (sessionId, dbconn) <- dateExamplesConnection emptyNotificationCallback
35 Right df <- executeDataFrameExpr sessionId dbconn (
37 convertExpr = Project (AttributeNames (S.singleton "status")) (RelationVariable "s" ()),
38 orderExprs = [AttributeOrderExpr "status" AscendingOrder],
42 let vals = map (\tup -> case atomForAttributeName "status" tup of
43 Left err -> error (show err)
44 Right atom -> atom) (tuples df)
45 assertEqual "sort + offset" [IntegerAtom 20, IntegerAtom 30] vals
48testLimit = TestCase $ do
49 (sessionId, dbconn) <- dateExamplesConnection emptyNotificationCallback
50 Right df <- executeDataFrameExpr sessionId dbconn (
52 convertExpr = Project (AttributeNames (S.singleton "status")) (RelationVariable "s" ()),
53 orderExprs = [AttributeOrderExpr "status" DescendingOrder],
57 let vals = map (\tup -> case atomForAttributeName "status" tup of
58 Left err -> error (show err)
59 Right atom -> atom) (tuples df)
60 assertEqual "sort + limit" [IntegerAtom 30] vals
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list