mirror of
https://github.com/github/semantic.git
synced 2024-12-22 06:11:49 +03:00
25 lines
717 B
Haskell
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
|