Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the test suite on Windows
Browse files Browse the repository at this point in the history
mrkkrp committed Jul 13, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 7683677 commit b13ea3d
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion test/TH.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
@@ -22,10 +23,18 @@ instance Foo Rel File


qqAbsDir :: FilePath
#ifdef mingw32_HOST_OS
qqAbsDir = foo [absdir|C:\foo\|]
#else
qqAbsDir = foo [absdir|/foo/|]
#endif

qqAbsFile :: FilePath
qqAbsFile = foo [absfile|/foo|]
#ifdef mingw32_HOST_OS
qqAbsFile = foo [absdir|C:\foo|]
#else
qqAbsFile = foo [absdir|/foo|]
#endif

qqRelDir :: FilePath
qqRelDir = foo [reldir|foo/|]
@@ -34,10 +43,18 @@ qqRelFile :: FilePath
qqRelFile = foo [relfile|foo|]

thAbsDir :: FilePath
#ifdef mingw32_HOST_OS
thAbsDir = foo $(mkAbsDir "C:\\foo\\")
#else
thAbsDir = foo $(mkAbsDir "/foo/")
#endif

thAbsFile :: FilePath
#ifdef mingw32_HOST_OS
thAbsFile = foo $(mkAbsFile "C:\\foo")
#else
thAbsFile = foo $(mkAbsFile "/foo")
#endif

thRelDir :: FilePath
thRelDir = foo $(mkRelDir "foo/")
@@ -46,10 +63,18 @@ thRelFile :: FilePath
thRelFile = foo $(mkRelFile "foo")

liftAbsDir :: FilePath
#ifdef mingw32_HOST_OS
liftAbsDir = foo $(TH.lift (Path "C:\\foo\\" :: Path Abs Dir))
#else
liftAbsDir = foo $(TH.lift (Path "/foo/" :: Path Abs Dir))
#endif

liftAbsFile :: FilePath
#ifdef mingw32_HOST_OS
liftAbsFile = foo $(TH.lift (Path "C:\\foo" :: Path Abs File))
#else
liftAbsFile = foo $(TH.lift (Path "/foo" :: Path Abs File))
#endif

liftRelDir :: FilePath
liftRelDir = foo $(TH.lift (Path "foo/" :: Path Rel Dir))

0 comments on commit b13ea3d

Please sign in to comment.