hcat/test/HCatSpec.hs

15 lines
402 B
Haskell

{-# LANGUAGE GHC2021 #-}
module HCatSpec (spec) where
import HCat.Internal (parseArgs)
import Test.Hspec
spec :: Spec
spec = do
describe "parseArgs" do
it "returns the filename if given a single argument" do
parseArgs ["foo"] `shouldBe` Right "foo"
parseArgs [] `shouldBe` Left "No filename given!"
parseArgs ["foo", "bar"] `shouldBe` Left "Only a single file is supported"