import Data.Char (Char)
import Control.Monad (Monad(..))
import Data.Int (Int)
-import Data.Function (($))
+import Data.Function (($), (.))
import Data.Functor ((<$>))
import Data.Semigroup (Semigroup(..))
import Data.String (String, IsString(..))
goldens :: TestTree
goldens = testGroup "Machine" $
(\f -> List.zipWith f (machines @Text) [1::Int ..]) $ \mach g ->
- let machineFile = "test/Golden/Machine/G"<>show g<>".expected.txt" in
+ let machineFile = getGoldenDir $ "Machine/G"<>show g<>".expected.txt" in
goldenVsStringDiff ("G"<>show g) goldenDiff machineFile $ do
resetTHNameCounter
m <- mach
machines ::
P.InputToken inp ~ Char =>
P.Cursorable (P.Cursor inp) =>
- P.Machine (P.InputToken inp) repr =>
+ P.Machinable (P.InputToken inp) repr =>
[IO (repr inp '[] String)]
-machines = P.optimizeMachine <$> grammars
+machines = P.optimizeMachine . P.optimizeGrammar <$> grammars