1import TutorialDInterpreter
6import qualified Data.HashSet as HS
7import qualified Data.Map as M
11 counts <- runTestTT (TestList tests)
12 if errors counts + failures counts > 0 then exitFailure else exitSuccess
14 tests = map (\(tutd, expected) -> TestCase $ assertTutdEqual basicDatabaseContext tutd expected) simpleRelTests
15 simpleRelTests = [("x:=true", Right relationTrue),
16 ("x:=false", Right relationFalse),
17 ("x:=true union false", Right relationTrue),
18 ("x:=true; x:=false", Right relationFalse),
19 ("x:=relation{a int}", mkRelation simpleAAttributes HS.empty),
20 ("x:=relation{c int} rename {c as d}", mkRelation simpleBAttributes HS.empty),
21 ("y:=relation{b int, c int}; x:=y{c}", mkRelation simpleProjectionAttributes HS.empty)
23 simpleAAttributes = M.fromList [("a", Attribute "a" IntAtomType)]
24 simpleBAttributes = M.fromList [("d", Attribute "d" IntAtomType)]
25 simpleProjectionAttributes = M.fromList [("c", Attribute "c" IntAtomType)]
28testSimple1 = TestCase $ assertTutdEqual basicDatabaseContext "true" (Right relationTrue)
30assertTutdEqual databaseContext tutd expected = assertEqual tutd interpreted expected
32 interpreted = case interpret databaseContext tutd of
33 (Just err, _) -> Left err
34 (Nothing, context) -> Right $ (relationVariables context) M.! "x"
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