turtle 1.3.3 → 1.3.4
raw patch · 4 files changed
+48/−4 lines, 4 filesdep ~basedep ~criteriondep ~system-filepath
Dependency ranges changed: base, criterion, system-filepath, temporary
Files
- CHANGELOG.md +6/−0
- src/Turtle/Prelude.hs +2/−2
- test/cptree.hs +26/−0
- turtle.cabal +14/−2
CHANGELOG.md view
@@ -1,3 +1,9 @@+1.3.4++* Bug fix: `cptree` now correctly copies files instead of creating directories+ of the same name+* Increase upper bound on `criterion`+ 1.3.3 * Bug fix: Change `textToLines` to behave like `Data.Text.splitOn "\n"`
src/Turtle/Prelude.hs view
@@ -1034,9 +1034,9 @@ -- directory Just suffix <- return (Filesystem.stripPrefix (oldTree </> "") oldPath) let newPath = newTree </> suffix- isFile <- testfile newPath+ isFile <- testfile oldPath if isFile- then cp oldPath newPath+ then mktree (Filesystem.directory newPath) >> cp oldPath newPath else mktree newPath ) -- | Remove a file
+ test/cptree.hs view
@@ -0,0 +1,26 @@+{-# LANGUAGE OverloadedStrings #-}++import Turtle+import Filesystem.Path.CurrentOS ()+import System.IO.Temp (withSystemTempDirectory)+import Control.Monad (unless)++check :: String -> Bool-> IO ()+check errorMessage successs = unless successs $ fail errorMessage++main :: IO ()+main = withSystemTempDirectory "tempDir" (runTest . fromString)++runTest :: Turtle.FilePath -> IO ()+runTest tempDir = do+ let srcDirectory = tempDir </> "src"++ mktree $ srcDirectory </> "directory"+ touch $ srcDirectory </> "directory" </> "file"++ let destDirectory = tempDir </> "dest"++ cptree srcDirectory destDirectory++ testdir (destDirectory </> "directory") >>= check "cptree did not preserve directory"+ testfile (destDirectory </> "directory" </> "file") >>= check "cptree did not preserve directory"
turtle.cabal view
@@ -1,5 +1,5 @@ Name: turtle-Version: 1.3.3+Version: 1.3.4 Cabal-Version: >=1.10 Build-Type: Simple License: BSD3@@ -119,6 +119,18 @@ base >= 4 && < 5, turtle +test-suite cptree+ Type: exitcode-stdio-1.0+ HS-Source-Dirs: test+ Main-Is: cptree.hs+ GHC-Options: -Wall -threaded+ Default-Language: Haskell2010+ Build-Depends:+ base >= 4 && < 5,+ temporary,+ system-filepath >= 0.4,+ turtle+ benchmark bench Type: exitcode-stdio-1.0 HS-Source-Dirs: bench@@ -132,4 +144,4 @@ if impl(ghc < 7.8) Build-Depends: criterion >= 0.4 && < 1.1.4.0 else- Build-Depends: criterion >= 0.4 && < 1.2+ Build-Depends: criterion >= 0.4 && < 1.3