1import TutorialDInterpreter
6import qualified Data.HashSet as HS
7import qualified Data.Map as M
9main = runTestTT (TestList tests)
11 tests = map (\(tutd, expected) -> TestCase $ assertTutdEqual basicRelVarContext tutd expected) simpleRelTests
12 simpleRelTests = [("true", Right relationTrue),
13 ("false", Right relationFalse),
14 ("true union false", Right relationTrue),
15 ("true; false", Right relationFalse),
16 ("a:=relation{a int}", mkRelation simpleAAttributes HS.empty),
17 ("b:=relation{c int} rename {c as d}", mkRelation simpleBAttributes HS.empty),
18 ("a:=relation{b int, c int}; a{c}", mkRelation simpleProjectionAttributes HS.empty)
20 simpleAAttributes = M.fromList [("a", Attribute "a" IntAtomType)]
21 simpleBAttributes = M.fromList [("d", Attribute "d" IntAtomType)]
22 simpleProjectionAttributes = M.fromList [("c", Attribute "c" IntAtomType)]
25testSimple1 = TestCase $ assertTutdEqual basicRelVarContext "true" (Right relationTrue)
27assertTutdEqual relVarContext tutd expected = assertEqual tutd interpreted expected
29 interpreted = fst (interpret relVarContext tutd)
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