1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 09:15:01 +03:00
semantic/test/ParseCommandSpec.hs
2017-02-28 15:32:04 -08:00

25 lines
717 B
Haskell

module ParseCommandSpec where
import Data.Functor.Listable
import Prelude
import Test.Hspec hiding (shouldBe, shouldNotBe, shouldThrow, errorCall)
import Test.Hspec.Expectations.Pretty
import Test.Hspec.LeanCheck
import Test.LeanCheck
import Arguments
import ParseCommand
import Renderer
spec :: Spec
spec = parallel $ do
context "parse" $ do
prop "all valid formats should produce output" . forAll (isParseFormat `filterT` tiers) $
\format -> do
output <- parse $ parseArgs ["test/fixtures/ruby/and-or.A.rb"] format
output `shouldNotBe` ""
isParseFormat :: Format -> Bool
isParseFormat a | JSON <- a = True
| SExpression <- a = True
| otherwise = False