Skip to content

Commit c378485

Browse files
committed
Scope absolute-path compressFile test to Posix
1 parent ef40314 commit c378485

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

test/App/Fossa/VendoredDependencySpec.hs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE TemplateHaskell #-}
23

34
module App.Fossa.VendoredDependencySpec (
@@ -15,9 +16,15 @@ import App.Fossa.VendoredDependency (
1516
)
1617
import Control.Carrier.Lift (sendIO)
1718
import Control.Effect.Path (withSystemTempDir)
18-
import Path (Abs, Dir, Path, mkRelDir, mkRelFile, toFilePath, (</>))
19+
import Path (Abs, Dir, Path, mkRelDir, (</>))
20+
#ifndef mingw32_HOST_OS
21+
import Path (mkRelFile, toFilePath)
22+
#endif
1923
import Path.IO (getCurrentDir)
20-
import Test.Effect (it', shouldContain', shouldStartWith')
24+
import Test.Effect (it', shouldContain')
25+
#ifndef mingw32_HOST_OS
26+
import Test.Effect (shouldStartWith')
27+
#endif
2128
import Test.Fixtures qualified as Fixtures
2229
import Test.Hspec (Spec, describe, it, runIO, shouldBe)
2330

@@ -43,6 +50,9 @@ spec = do
4350
compressedFilePath <- sendIO $ withSystemTempDir "fossa-temp" (flippedCompressFile specDir fileToTar)
4451
compressedFilePath `shouldContain'` fileToTar
4552

53+
#ifndef mingw32_HOST_OS
54+
-- Posix-only: safeSeparators uses System.FilePath.Posix, and the customer
55+
-- bug only manifests for Posix-style absolute paths produced by meta-fossa.
4656
it' "should write the tarball inside outputDir when fileToTar is absolute" $
4757
do
4858
let specDir = currDir </> $(mkRelDir "test/ArchiveUploader/normal")
@@ -51,6 +61,7 @@ spec = do
5161
sendIO . withSystemTempDir "fossa-temp" $ \out ->
5262
(toFilePath out,) <$> compressFile out specDir absFile
5363
compressedFilePath `shouldStartWith'` outDirStr
64+
#endif
5465

5566
describe "safeSeparators" $ do
5667
it "joins relative path components with underscores" $

0 commit comments

Comments
 (0)