Skip to content

Commit

Permalink
Fix some hlint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Jan 18, 2019
1 parent 0b33207 commit a87c9bd
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/test/Stack/Types/TemplateNameSpec.hs
Expand Up @@ -14,38 +14,38 @@ spec =
let pathOf s = either error templatePath (parseTemplateNameFromString s)

it "parses out the TemplatePath" $ do
pathOf "github:user/name" `shouldBe` (RepoPath $ RepoTemplatePath Github "user" "name.hsfiles")
pathOf "bitbucket:user/name" `shouldBe` (RepoPath $ RepoTemplatePath Bitbucket "user" "name.hsfiles")
pathOf "gitlab:user/name" `shouldBe` (RepoPath $ RepoTemplatePath Gitlab "user" "name.hsfiles")
pathOf "github:user/name" `shouldBe` RepoPath (RepoTemplatePath Github "user" "name.hsfiles")
pathOf "bitbucket:user/name" `shouldBe` RepoPath (RepoTemplatePath Bitbucket "user" "name.hsfiles")
pathOf "gitlab:user/name" `shouldBe` RepoPath (RepoTemplatePath Gitlab "user" "name.hsfiles")

pathOf "http://www.com/file" `shouldBe` UrlPath "http://www.com/file"
pathOf "https://www.com/file" `shouldBe` UrlPath "https://www.com/file"

pathOf "name" `shouldBe` (RelPath "name.hsfiles" $ Path "name.hsfiles")
pathOf "name.hsfile" `shouldBe` (RelPath "name.hsfile.hsfiles" $ Path "name.hsfile.hsfiles")
pathOf "name.hsfiles" `shouldBe` (RelPath "name.hsfiles" $ Path "name.hsfiles")
pathOf "" `shouldBe` (RelPath ".hsfiles" $ Path ".hsfiles")
pathOf "name" `shouldBe` RelPath "name.hsfiles" (Path "name.hsfiles")
pathOf "name.hsfile" `shouldBe` RelPath "name.hsfile.hsfiles" (Path "name.hsfile.hsfiles")
pathOf "name.hsfiles" `shouldBe` RelPath "name.hsfiles" (Path "name.hsfiles")
pathOf "" `shouldBe` RelPath ".hsfiles" (Path ".hsfiles")

if os == "mingw32"
then do
pathOf "//home/file" `shouldBe` (AbsPath $ Path "\\\\home\\file.hsfiles")
pathOf "/home/file" `shouldBe` (RelPath "/home/file.hsfiles" $ Path "\\home\\file.hsfiles")
pathOf "/home/file.hsfiles" `shouldBe` (RelPath "/home/file.hsfiles" $ Path "\\home\\file.hsfiles")
pathOf "//home/file" `shouldBe` AbsPath (Path "\\\\home\\file.hsfiles")
pathOf "/home/file" `shouldBe` RelPath "/home/file.hsfiles" (Path "\\home\\file.hsfiles")
pathOf "/home/file.hsfiles" `shouldBe` RelPath "/home/file.hsfiles" (Path "\\home\\file.hsfiles")

pathOf "c:\\home\\file" `shouldBe` (AbsPath $ Path "C:\\home\\file.hsfiles")
pathOf "with/slash" `shouldBe` (RelPath "with/slash.hsfiles" $ Path "with\\slash.hsfiles")
pathOf "c:\\home\\file" `shouldBe` AbsPath (Path "C:\\home\\file.hsfiles")
pathOf "with/slash" `shouldBe` RelPath "with/slash.hsfiles" (Path "with\\slash.hsfiles")

let colonAction =
do
return $! pathOf "with:colon"
colonAction `shouldThrow` anyErrorCall

else do
pathOf "//home/file" `shouldBe` (AbsPath $ Path "/home/file.hsfiles")
pathOf "/home/file" `shouldBe` (AbsPath $ Path "/home/file.hsfiles")
pathOf "/home/file.hsfiles" `shouldBe` (AbsPath $ Path "/home/file.hsfiles")
pathOf "//home/file" `shouldBe` AbsPath (Path "/home/file.hsfiles")
pathOf "/home/file" `shouldBe` AbsPath (Path "/home/file.hsfiles")
pathOf "/home/file.hsfiles" `shouldBe` AbsPath (Path "/home/file.hsfiles")

pathOf "c:\\home\\file" `shouldBe` (RelPath "c:\\home\\file.hsfiles" $ Path "c:\\home\\file.hsfiles")
pathOf "with/slash" `shouldBe` (RelPath "with/slash.hsfiles" $ Path "with/slash.hsfiles")
pathOf "with:colon" `shouldBe` (RelPath "with:colon.hsfiles" $ Path "with:colon.hsfiles")
pathOf "c:\\home\\file" `shouldBe` RelPath "c:\\home\\file.hsfiles" (Path "c:\\home\\file.hsfiles")
pathOf "with/slash" `shouldBe` RelPath "with/slash.hsfiles" (Path "with/slash.hsfiles")
pathOf "with:colon" `shouldBe` RelPath "with:colon.hsfiles" (Path "with:colon.hsfiles")

0 comments on commit a87c9bd

Please sign in to comment.