summaryrefslogtreecommitdiff
path: root/testsuite/tests/module/T1074a.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/module/T1074a.hs')
-rw-r--r--testsuite/tests/module/T1074a.hs28
1 files changed, 28 insertions, 0 deletions
diff --git a/testsuite/tests/module/T1074a.hs b/testsuite/tests/module/T1074a.hs
new file mode 100644
index 0000000000..0fcbdf600f
--- /dev/null
+++ b/testsuite/tests/module/T1074a.hs
@@ -0,0 +1,28 @@
+{-# OPTIONS_GHC -fwarn-unused-imports #-}
+
+module Test where
+
+import qualified System.FilePath as FilePath.Native
+ ( joinPath )
+import qualified System.FilePath.Posix as FilePath.Posix
+ ( joinPath, splitDirectories )
+import qualified System.FilePath.Windows as FilePath.Windows
+ ( joinPath )
+
+data TarPath = TarPath FilePath -- path name, 100 characters max.
+ FilePath -- path prefix, 155 characters max.
+
+fromTarPath, fromTarPathToPosixPath
+ , fromTarPathToWindowsPath :: TarPath -> FilePath
+
+fromTarPath (TarPath name prefix) =
+ FilePath.Native.joinPath $ FilePath.Posix.splitDirectories prefix
+ ++ FilePath.Posix.splitDirectories name
+
+fromTarPathToPosixPath (TarPath name prefix) =
+ FilePath.Posix.joinPath $ FilePath.Posix.splitDirectories prefix
+ ++ FilePath.Posix.splitDirectories name
+
+fromTarPathToWindowsPath (TarPath name prefix) =
+ FilePath.Windows.joinPath $ FilePath.Posix.splitDirectories prefix
+ ++ FilePath.Posix.splitDirectories name