From 7230d9caceaed24b667b863ff2b8c8ba40ca577d Mon Sep 17 00:00:00 2001 From: Adithya Kumar Date: Thu, 19 Dec 2024 22:38:46 +0530 Subject: [PATCH] fixup! Add a normalized path equality check operation --- streamly.cabal | 1 - test/Streamly/Test/FileSystem/Path.hs | 61 --------------------------- test/streamly-tests.cabal | 6 --- 3 files changed, 68 deletions(-) delete mode 100644 test/Streamly/Test/FileSystem/Path.hs diff --git a/streamly.cabal b/streamly.cabal index ca092d096b..6c7295e28b 100644 --- a/streamly.cabal +++ b/streamly.cabal @@ -127,7 +127,6 @@ extra-source-files: test/Streamly/Test/FileSystem/Event/Windows.hs test/Streamly/Test/FileSystem/Event/Linux.hs test/Streamly/Test/FileSystem/Handle.hs - test/Streamly/Test/FileSystem/Path.hs test/Streamly/Test/Network/Socket.hs test/Streamly/Test/Network/Inet/TCP.hs test/Streamly/Test/Prelude.hs diff --git a/test/Streamly/Test/FileSystem/Path.hs b/test/Streamly/Test/FileSystem/Path.hs deleted file mode 100644 index e2f7873740..0000000000 --- a/test/Streamly/Test/FileSystem/Path.hs +++ /dev/null @@ -1,61 +0,0 @@ --- | --- Module : Streamly.Test.FileSystem.Path --- Copyright : (c) 2021 Composewell Technologies --- License : BSD-3-Clause --- Maintainer : streamly@composewell.com --- Stability : experimental --- Portability : GHC --- - -module Streamly.Test.FileSystem.Path (main) where - -import qualified System.FilePath as FilePath -import qualified Streamly.Internal.FileSystem.Path as Path - -import Test.Hspec as H - -moduleName :: String -moduleName = "FileSystem.Path" - -testNormalize :: String -> Spec -testNormalize inp = - it ("normalize: " ++ show inp) $ do - p <- Path.fromString inp - let expected = FilePath.normalise inp - got = Path.toString (Path.normalize p) - got `shouldBe` expected - -main :: IO () -main = - hspec $ - H.parallel $ - describe moduleName $ do - describe "normalize" $ do - -- Primarily for Windows - testNormalize "C:\\" - testNormalize "C:" - testNormalize "\\\\?\\c:\\" - testNormalize "c:\\file/bob\\" - testNormalize "c:\\" - testNormalize "c:\\\\\\\\" - testNormalize "C:.\\" - testNormalize "\\\\server\\test" - testNormalize "//server/test" - testNormalize "c:/file" - testNormalize "/file" - testNormalize "\\" - -- Primarily for Posix - testNormalize "/./" - testNormalize "/file/\\test////" - testNormalize "/file/./test" - testNormalize "/test/file/../bob/fred/" - testNormalize "../bob/fred/" - testNormalize "/a/../c" - testNormalize "./bob/fred/" - testNormalize "." - testNormalize "./" - testNormalize "./." - testNormalize "/./" - testNormalize "/" - testNormalize "bob/fred/." - testNormalize "//home" diff --git a/test/streamly-tests.cabal b/test/streamly-tests.cabal index 4564d2a87b..bef27c55f4 100644 --- a/test/streamly-tests.cabal +++ b/test/streamly-tests.cabal @@ -445,12 +445,6 @@ test-suite FileSystem.Handle if flag(use-streamly-core) buildable: False -test-suite FileSystem.Path - import: test-options - type: exitcode-stdio-1.0 - main-is: Streamly/Test/FileSystem/Path.hs - ghc-options: -main-is Streamly.Test.FileSystem.Path.main - test-suite Network.Inet.TCP import: lib-options type: exitcode-stdio-1.0