Move code to Internal module and add tests
This commit is contained in:
parent
2ac76cb650
commit
ace38dcebc
6 changed files with 89 additions and 15 deletions
15
test/HCatSpec.hs
Normal file
15
test/HCatSpec.hs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{-# 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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue