on master help sign in
WIP compilation checkpoint for tests now requiring parser-combinators
1d20536AgentM
project-m36.cabal+6−6
@@ -257,7 +257,7 @@ Test-Suite test-tutoriald-atomfunctionscript
257 type: exitcode-stdio-1.0
257 type: exitcode-stdio-1.0
258 Other-Modules: TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.TestBase, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types, TutorialD.Interpreter.SchemaOperator
258 Other-Modules: TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.TestBase, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types, TutorialD.Interpreter.SchemaOperator
259 main-is: test/TutorialD/Interpreter/AtomFunctionScript.hs
259 main-is: test/TutorialD/Interpreter/AtomFunctionScript.hs
260− Build-Depends: base, HUnit, project-m36, uuid, containers, megaparsec, text, vector, directory, bytestring, mtl, haskeline, random, MonadRandom, semigroups, time
260+ Build-Depends: base, HUnit, project-m36, uuid, containers, megaparsec, text, vector, directory, bytestring, mtl, haskeline, random, MonadRandom, semigroups, time, parser-combinators
261 GHC-Options: -Wall -threaded
261 GHC-Options: -Wall -threaded
262 Hs-Source-Dirs: ./src/bin, ./test, .
262 Hs-Source-Dirs: ./src/bin, ./test, .
263
263
@@ -267,7 +267,7 @@ Test-Suite test-tutoriald-databasecontextfunctionscript
267 type: exitcode-stdio-1.0
267 type: exitcode-stdio-1.0
268 Other-Modules: TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.TestBase, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types, TutorialD.Interpreter.SchemaOperator
268 Other-Modules: TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.TestBase, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types, TutorialD.Interpreter.SchemaOperator
269 main-is: test/TutorialD/Interpreter/DatabaseContextFunctionScript.hs
269 main-is: test/TutorialD/Interpreter/DatabaseContextFunctionScript.hs
270− Build-Depends: base, HUnit, project-m36, uuid, containers, megaparsec, text, vector, directory, bytestring, mtl, haskeline, random, MonadRandom, semigroups, time
270+ Build-Depends: base, HUnit, project-m36, uuid, containers, megaparsec, text, vector, directory, bytestring, mtl, haskeline, random, MonadRandom, semigroups, time, parser-combinators
271 GHC-Options: -Wall -threaded
271 GHC-Options: -Wall -threaded
272 Hs-Source-Dirs: ./src/bin, ./test, .
272 Hs-Source-Dirs: ./src/bin, ./test, .
273
273
@@ -292,7 +292,7 @@ Test-Suite test-transactiongraph-persist
292 Default-Extensions: OverloadedStrings
292 Default-Extensions: OverloadedStrings
293 type: exitcode-stdio-1.0
293 type: exitcode-stdio-1.0
294 main-is: test/TransactionGraph/Persist.hs
294 main-is: test/TransactionGraph/Persist.hs
295− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, stm-containers, project-m36, random, MonadRandom, semigroups
295+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, stm-containers, project-m36, random, MonadRandom, semigroups, parser-combinators
296 Other-Modules: TutorialD.Interpreter.Base, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.Types, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.Import.BasicExamples
296 Other-Modules: TutorialD.Interpreter.Base, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.Types, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.Import.BasicExamples
297 Hs-Source-Dirs: ., ./src/bin
297 Hs-Source-Dirs: ., ./src/bin
298 GHC-Options: -Wall -threaded
298 GHC-Options: -Wall -threaded
@@ -310,7 +310,7 @@ Test-Suite test-tutoriald-import-tutoriald
310 Default-Extensions: OverloadedStrings
310 Default-Extensions: OverloadedStrings
311 type: exitcode-stdio-1.0
311 type: exitcode-stdio-1.0
312 main-is: test/TutorialD/Interpreter/Import/TutorialD.hs
312 main-is: test/TutorialD/Interpreter/Import/TutorialD.hs
313− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, stm-containers, project-m36, random, MonadRandom, semigroups
313+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, stm-containers, project-m36, random, MonadRandom, semigroups, parser-combinators
314 Other-Modules: TutorialD.Interpreter.Base, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.Types, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.Import.BasicExamples
314 Other-Modules: TutorialD.Interpreter.Base, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.Types, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.Import.BasicExamples
315 GHC-Options: -Wall -threaded
315 GHC-Options: -Wall -threaded
316 Hs-Source-Dirs: ., ./src/bin
316 Hs-Source-Dirs: ., ./src/bin
@@ -408,7 +408,7 @@ Test-Suite test-websocket-server
408 Default-Language: Haskell2010
408 Default-Language: Haskell2010
409 type: exitcode-stdio-1.0
409 type: exitcode-stdio-1.0
410 main-is: test/Server/WebSocket.hs
410 main-is: test/Server/WebSocket.hs
411− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t, websockets, optparse-applicative, network, aeson, project-m36, random, MonadRandom, network-transport-tcp, semigroups
411+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t, websockets, optparse-applicative, network, aeson, project-m36, random, MonadRandom, network-transport-tcp, semigroups, parser-combinators
412 Other-Modules: TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.TransactionGraphOperator, ProjectM36.Client.Json, ProjectM36.Server.RemoteCallTypes.Json, ProjectM36.Server.WebSocket, TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.Types, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.SchemaOperator
412 Other-Modules: TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.TransactionGraphOperator, ProjectM36.Client.Json, ProjectM36.Server.RemoteCallTypes.Json, ProjectM36.Server.WebSocket, TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.Types, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.SchemaOperator
413 Default-Extensions: OverloadedStrings
413 Default-Extensions: OverloadedStrings
414 GHC-Options: -Wall -threaded
414 GHC-Options: -Wall -threaded
@@ -446,7 +446,7 @@ Test-Suite test-transactiongraph-automerge
446 Default-Language: Haskell2010
446 Default-Language: Haskell2010
447 type: exitcode-stdio-1.0
447 type: exitcode-stdio-1.0
448 main-is: test/TransactionGraph/Automerge.hs
448 main-is: test/TransactionGraph/Automerge.hs
449− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t, websockets, optparse-applicative, network, aeson, project-m36, random, MonadRandom, semigroups
449+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t, websockets, optparse-applicative, network, aeson, project-m36, random, MonadRandom, semigroups, parser-combinators
450 Other-Modules: TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.SchemaOperator, TutorialD.Interpreter.TestBase, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types
450 Other-Modules: TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.SchemaOperator, TutorialD.Interpreter.TestBase, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types
451 Default-Extensions: OverloadedStrings
451 Default-Extensions: OverloadedStrings
452 GHC-Options: -Wall -threaded
452 GHC-Options: -Wall -threaded
src/lib/ProjectM36/Base.hs+1−1
@@ -431,7 +431,7 @@ data Transaction = Transaction TransactionId TransactionInfo Schemas
431
431
432-- | The disconnected transaction represents an in-progress workspace used by sessions before changes are committed. This is similar to git's "index". After a transaction is committed, it is "connected" in the transaction graph and can no longer be modified.
432-- | The disconnected transaction represents an in-progress workspace used by sessions before changes are committed. This is similar to git's "index". After a transaction is committed, it is "connected" in the transaction graph and can no longer be modified.
433data DisconnectedTransaction = DisconnectedTransaction TransactionId Schemas DatabaseContextExpr
433data DisconnectedTransaction = DisconnectedTransaction TransactionId Schemas DatabaseContextExpr
434−--the database context expression represents a difference between the disconnected transaction and its immutable parent transaction
434+--the database context expression represents a difference between the disconnected transaction and its immutable parent transaction- is this diff expr used at all?
435
435
436type DirtyFlag = Bool
436type DirtyFlag = Bool
437
437
test/TransactionGraph/Persist.hs+6−6
@@ -29,8 +29,8 @@ testList = TestList [testBootstrapDB,
29 testFunctionPersistence]
29 testFunctionPersistence]
30
30
31
31
32−stamp :: UTCTime
32+stamp' :: UTCTime
33−stamp = UTCTime (fromGregorian 1980 01 01) (secondsToDiffTime 1000)
33+stamp' = UTCTime (fromGregorian 1980 01 01) (secondsToDiffTime 1000)
34
34
35{- bootstrap a database, ensure that it can be read -}
35{- bootstrap a database, ensure that it can be read -}
36testBootstrapDB :: Test
36testBootstrapDB :: Test
@@ -38,7 +38,7 @@ testBootstrapDB = TestCase $ withSystemTempDirectory "m36testdb" $ \tempdir -> d
38 let dbdir = tempdir </> "dbdir"
38 let dbdir = tempdir </> "dbdir"
39 freshId <- nextRandom
39 freshId <- nextRandom
40
40
41− _ <- bootstrapDatabaseDir NoDiskSync dbdir (bootstrapTransactionGraph stamp freshId dateExamples)
41+ _ <- bootstrapDatabaseDir NoDiskSync dbdir (bootstrapTransactionGraph stamp' freshId dateExamples)
42 loadedGraph <- transactionGraphLoad dbdir emptyTransactionGraph Nothing
42 loadedGraph <- transactionGraphLoad dbdir emptyTransactionGraph Nothing
43 assertBool "transactionGraphLoad" $ isRight loadedGraph
43 assertBool "transactionGraphLoad" $ isRight loadedGraph
44
44
@@ -48,17 +48,17 @@ testDBSimplePersistence = TestCase $ withSystemTempDirectory "m36testdb" $ \temp
48 let dbdir = tempdir </> "dbdir"
48 let dbdir = tempdir </> "dbdir"
49 freshId <- nextRandom
49 freshId <- nextRandom
50
50
51− let graph = bootstrapTransactionGraph stamp freshId dateExamples
51+ let graph = bootstrapTransactionGraph stamp' freshId dateExamples
52 _ <- bootstrapDatabaseDir NoDiskSync dbdir graph
52 _ <- bootstrapDatabaseDir NoDiskSync dbdir graph
53 case transactionForHead "master" graph of
53 case transactionForHead "master" graph of
54 Nothing -> assertFailure "Failed to retrieve head transaction for master branch."
54 Nothing -> assertFailure "Failed to retrieve head transaction for master branch."
55 Just headTrans ->
55 Just headTrans ->
56− case interpretDatabaseContextExpr (concreteDatabaseContext headTrans) "x:=s" of
56+ case interpretDatabaseContextExpr (concreteDatabaseContext headTrans) (transactionId headTrans) graph "x:=s" of
57 Left err -> assertFailure (show err)
57 Left err -> assertFailure (show err)
58 Right context' -> do
58 Right context' -> do
59 freshId' <- nextRandom
59 freshId' <- nextRandom
60 let newdiscon = DisconnectedTransaction (transactionId headTrans) (Schemas context' M.empty) True
60 let newdiscon = DisconnectedTransaction (transactionId headTrans) (Schemas context' M.empty) True
61− addTrans = addDisconnectedTransaction stamp freshId' "master" newdiscon graph
61+ addTrans = addDisconnectedTransaction stamp' freshId' "master" newdiscon graph
62 --add a transaction to the graph
62 --add a transaction to the graph
63 case addTrans of
63 case addTrans of
64 Left err -> assertFailure (show err)
64 Left err -> assertFailure (show err)