Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Main where
- import Test.Tasty
- import Test1 (hspecTestTree)
- main :: IO ()
- main = hspecTestTree >>= \unitTests ->
- let allTests = testGroup "Parser" [unitTests]
- in defaultMain allTests
- ----------------------------------------------------------------------
- module Test1
- ( hspecTestTree
- ) where
- import Data.Maybe
- import Task1
- import Test.Tasty
- import Test.Tasty.Hspec (Spec, describe, it, shouldBe, shouldSatisfy, testSpec)
- hspecTestTree :: IO TestTree
- hspecTestTree = testSpec "Simple parser" spec_Parser
- spec_Parser :: Spec
- spec_Parser = do
- describe "eof works" $ do
- it "eof on empty input" $
- runP eof "" `shouldSatisfy` isJust
- it "eof on non-empty input" $
- runP eof "x" `shouldSatisfy` isNothing
- describe "char works" $ do
- it "char parses character" $
- runP (element 'a') "abc" `shouldBe` Just ('x', "bc")
- ----------------------------------------------------------------------
- name: hw1-second-chance
- version: 0.1.0.0
- synopsis: Synopsis for task 1
- description: Task 1 for FP ITMO course
- license: MIT
- license-file: LICENSE
- author: Author name here
- maintainer: example@example.com
- copyright: 2020 Author name here
- category: Web
- build-type: Simple
- extra-source-files: README.md
- cabal-version: >=1.10
- tested-with: GHC == 8.0.1
- library
- hs-source-dirs: src
- exposed-modules: Task1
- ghc-options: -Wall
- build-depends: base >= 4.9 && < 5
- default-language: Haskell2010
- executable hw1-second-chance
- hs-source-dirs: app
- main-is: Main.hs
- ghc-options: -Wall -Werror -threaded -rtsopts -with-rtsopts=-N
- build-depends: base
- , hw1-second-chance
- default-language: Haskell2010
- test-suite hw1-second-chance-test
- type: exitcode-stdio-1.0
- hs-source-dirs: test
- main-is: Spec.hs
- other-modules: Test1
- build-depends: base >= 4.9 && <5
- ,tasty
- ,tasty-hunit
- ,tasty-hspec
- ,tasty-quickcheck
- ,tasty-smallcheck
- ,hw1-second-chance
- ghc-options: -Wall -Werror -threaded -rtsopts -with-rtsopts=-N
- default-language: Haskell2010
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement