haskell-brainfuck 0.1.0.0 → 0.1.0.1
raw patch · 5 files changed
+32/−39 lines, 5 filesdep +tasty-th
Dependencies added: tasty-th
Files
- README.md +6/−0
- haskell-brainfuck.cabal +9/−6
- src/HaskBF/Parser.hs +6/−2
- test/test.hs +11/−0
- tests/test.hs +0/−31
README.md view
@@ -39,5 +39,11 @@ brainfuck fib.bf ``` +## Tests+You can run the test suite with+```bash+cabal test+```+ ## Documentation http://paraseba.github.io/haskell-brainfuck/
haskell-brainfuck.cabal view
@@ -1,5 +1,5 @@ name: haskell-brainfuck-version: 0.1.0.0+version: 0.1.0.1 synopsis: BrainFuck interpreter @@ -31,10 +31,10 @@ exposed-modules: HaskBF.Parser, HaskBF.Tape, HaskBF.Eval hs-source-dirs: src/- build-depends: base >=4.7 && <4.8- ,bytestring==0.10.4.0- ,parsec==3.1.5- ,mtl==2.1.3.1+ build-depends: base >=4.7 && <4.8+ , bytestring==0.10.4.0+ , parsec==3.1.5+ , mtl==2.1.3.1 default-extensions: TupleSections default-language: Haskell2010 ghc-options: -Wall -fwarn-tabs -fno-warn-unused-do-bind -fno-warn-deprecated-flags@@ -52,11 +52,14 @@ type: exitcode-stdio-1.0 main-is: test.hs default-language: Haskell2010- hs-source-dirs: tests+ hs-source-dirs: test+ ghc-options: -threaded+ default-extensions: TemplateHaskell build-depends: base >=4.7 && <4.8 , haskell-brainfuck , bytestring==0.10.4.0 , mtl==2.1.3.1 , tasty==0.8.1.3 , tasty-quickcheck==0.8.1+ , tasty-th==0.1.2 , QuickCheck==2.7.5
src/HaskBF/Parser.hs view
@@ -64,8 +64,12 @@ operation = simpleOp <|> loop simpleChar :: Parser Char-simpleChar = (char '>') <|> (char '<') <|> (char '+') <|>- (char '-') <|> (char '.') <|> (char ',')+simpleChar = char '>' <|>+ char '<' <|>+ char '+' <|>+ char '-' <|>+ char '.' <|>+ char ',' simpleOp :: Parser Op simpleOp = fmap build simpleChar
+ test/test.hs view
@@ -0,0 +1,11 @@+import qualified Test.Parser+import qualified Test.Tape+import qualified Test.Eval+import Test.Helper++main = defaultMain $ testGroup "Tests" tests+ where tests = [ Test.Parser.tests+ , Test.Tape.tests+ , Test.Eval.tests+ ]+
− tests/test.hs
@@ -1,31 +0,0 @@--{-main :: IO ()-}-{-main = do-}- {-Test.Parser.tests-}--import Test.Tasty-import Test.Tasty.QuickCheck as QC-import Test.QuickCheck (Testable)--import Data.List-import Data.Ord--import qualified Test.Parser-import qualified Test.Tape-import qualified Test.Eval--main = defaultMain tests--tests :: TestTree-tests = testGroup "Tests" [properties]--properties :: TestTree-properties = testGroup "Properties" qcProps--mkGroup :: Testable prop => TestName -> [(TestName, prop)] -> TestTree-mkGroup name tests = testGroup name $ map (uncurry QC.testProperty) tests--qcProps = [mkGroup "Parser" Test.Parser.properties- ,mkGroup "Tape" Test.Tape.properties- ,mkGroup "Eval" Test.Eval.properties- ]