[commit: packages/filepath] master: Add 'Valid x =>' to splitExtension(s) QuickCheck property (#34) (d05cbe9)

git at git.haskell.org git at git.haskell.org
Thu Mar 19 11:36:44 UTC 2015


Repository : ssh://git@git.haskell.org/filepath

On branch  : master
Link       : http://git.haskell.org/packages/filepath.git/commitdiff/d05cbe90e5d74e30aa3544a4e3d37b3c8170d71a

>---------------------------------------------------------------

commit d05cbe90e5d74e30aa3544a4e3d37b3c8170d71a
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date:   Fri Oct 31 23:52:26 2014 +0100

    Add 'Valid x =>' to splitExtension(s) QuickCheck property (#34)


>---------------------------------------------------------------

d05cbe90e5d74e30aa3544a4e3d37b3c8170d71a
 System/FilePath/Internal.hs | 4 ++--
 tests/TestGen.hs            | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/System/FilePath/Internal.hs b/System/FilePath/Internal.hs
index bd02ddd..2487167 100644
--- a/System/FilePath/Internal.hs
+++ b/System/FilePath/Internal.hs
@@ -202,7 +202,7 @@ getSearchPath = fmap splitSearchPath (getEnv "PATH")
 -- | Split on the extension. 'addExtension' is the inverse.
 --
 -- > uncurry (++) (splitExtension x) == x
--- > uncurry addExtension (splitExtension x) == x
+-- > Valid x => uncurry addExtension (splitExtension x) == x
 -- > splitExtension "file.txt" == ("file",".txt")
 -- > splitExtension "file" == ("file","")
 -- > splitExtension "file/file.txt" == ("file/file",".txt")
@@ -274,7 +274,7 @@ hasExtension = any isExtSeparator . takeFileName
 -- | Split on all extensions
 --
 -- > uncurry (++) (splitExtensions x) == x
--- > uncurry addExtension (splitExtensions x) == x
+-- > Valid x => uncurry addExtension (splitExtensions x) == x
 -- > splitExtensions "file.tar.gz" == ("file",".tar.gz")
 splitExtensions :: FilePath -> (FilePath, String)
 splitExtensions x = (a ++ c, d)
diff --git a/tests/TestGen.hs b/tests/TestGen.hs
index 378b9f0..b2c5457 100755
--- a/tests/TestGen.hs
+++ b/tests/TestGen.hs
@@ -536,9 +536,9 @@ block11 = do
  putStrLn "Test 253, from line 204"
  test (\ (QFilePath x) -> (uncurry ( ++ ) ( P.splitExtension x ) == x))
  putStrLn "Test 254, from line 205"
- test (\ (QFilePath x) -> (uncurry W.addExtension ( W.splitExtension x ) == x))
+ test (\ (QFilePath x) -> ((\ x -> uncurry W.addExtension ( W.splitExtension x ) == x ) ( W.makeValid x )))
  putStrLn "Test 255, from line 205"
- test (\ (QFilePath x) -> (uncurry P.addExtension ( P.splitExtension x ) == x))
+ test (\ (QFilePath x) -> ((\ x -> uncurry P.addExtension ( P.splitExtension x ) == x ) ( P.makeValid x )))
  putStrLn "Test 256, from line 223"
  test (\ (QFilePath x) -> (W.takeExtension x == snd ( W.splitExtension x )))
  putStrLn "Test 257, from line 223"
@@ -568,9 +568,9 @@ block11 = do
  putStrLn "Test 269, from line 276"
  test (\ (QFilePath x) -> (uncurry ( ++ ) ( P.splitExtensions x ) == x))
  putStrLn "Test 270, from line 277"
- test (\ (QFilePath x) -> (uncurry W.addExtension ( W.splitExtensions x ) == x))
+ test (\ (QFilePath x) -> ((\ x -> uncurry W.addExtension ( W.splitExtensions x ) == x ) ( W.makeValid x )))
  putStrLn "Test 271, from line 277"
- test (\ (QFilePath x) -> (uncurry P.addExtension ( P.splitExtensions x ) == x))
+ test (\ (QFilePath x) -> ((\ x -> uncurry P.addExtension ( P.splitExtensions x ) == x ) ( P.makeValid x )))
  putStrLn "Test 272, from line 287"
  test (\ (QFilePath x) -> (not $ W.hasExtension ( W.dropExtensions x )))
  putStrLn "Test 273, from line 287"



More information about the ghc-commits mailing list