Category: Compilers/Interpreters
Synopsis: Interpreter for the Dyna language
Description: A weighted logic programming language for dynamic
- programming and natural language processing. Features
- include memoization, both forward- and backward-chaining,
- and namespace modularity.
+ programming and natural language processing.
+
+ -- Features include memoization, both forward- and
+ -- backward-chaining, and namespace modularity.
source-repository head
type: git
tagged >= 0.4.4,
template-haskell,
test-framework >=0.6,
+ test-framework-golden >= 1.1,
test-framework-hunit >=0.2,
+ test-framework-program >= 1.1,
test-framework-quickcheck2 >=0.3,
test-framework-th >=0.2,
- test-framework-golden >= 1.1,
transformers >= 0.3,
trifecta >= 1.0,
unordered-containers>=0.2,
-- Header material {{{
{-# LANGUAGE ImplicitParams #-}
+{-# LANGUAGE TemplateHaskell #-}
module Dyna.Backend.Python.Selftest where
import Control.Exception (throw)
import System.IO
import System.IO.Error
import System.Process
-import qualified Test.Framework as TF
+import Test.Framework as TF
+import Test.Framework.Providers.Program
+import Test.Framework.TH
import Test.Golden
------------------------------------------------------------------------}}}
, "examples/" ++ name ++ ".dyna.py.out"
, "examples/expected/" ++ name ++ ".py.out")
-goldens :: TF.Test
-goldens = TF.testGroup "Python Backend End-To-End"
- -- Sorted roughly by likelihood that all subsequent examples
- -- will be broken. ;)
- $ map mkExample [ "simple", "fib-limit", "dijkstra"
- , "papa2", "matrixops"
- ]
+-- Sorted roughly by likelihood that all subsequent examples
+-- will be broken. ;)
+test_End_To_End :: [Test]
+test_End_To_End = map mkExample
+ [ "simple", "fib-limit", "dijkstra", "papa2", "matrixops" ]
+
+test_REPL :: [Test]
+test_REPL = map (\n -> testProgramRuns n ("./test/repl/"++n) [])
+ [ "aggregator-conflict", "retract-rule" ]
------------------------------------------------------------------------}}}
-- Harness toplevel {{{
selftest :: TF.Test
-selftest = goldens
+selftest = $(testGroupGenerator)
main :: IO ()
-main = TF.defaultMain [selftest]
+main = $(defaultMainGenerator)
-- If you're running from within GHCi and just want to do something quickly,
-- try