[commit: packages/filepath] bgamari-patch-1, master: #54, document the behaviour of <.> with an empty extension (52cb8fd)

git at git.haskell.org git at git.haskell.org
Mon Apr 17 21:35:27 UTC 2017


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

On branches: bgamari-patch-1,master
Link       : http://git.haskell.org/packages/filepath.git/commitdiff/52cb8fd3003fa1c91324ced300d865f6168c6f4f

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

commit 52cb8fd3003fa1c91324ced300d865f6168c6f4f
Author: Neil Mitchell <ndmitchell at gmail.com>
Date:   Mon Nov 14 21:29:34 2016 +0000

    #54, document the behaviour of <.> with an empty extension


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

52cb8fd3003fa1c91324ced300d865f6168c6f4f
 System/FilePath/Internal.hs | 1 +
 changelog.md                | 2 ++
 tests/TestGen.hs            | 2 ++
 3 files changed, 5 insertions(+)

diff --git a/System/FilePath/Internal.hs b/System/FilePath/Internal.hs
index df4b39c..4a376b3 100644
--- a/System/FilePath/Internal.hs
+++ b/System/FilePath/Internal.hs
@@ -292,6 +292,7 @@ dropExtension = fst . splitExtension
 -- > addExtension "file." ".bib" == "file..bib"
 -- > addExtension "file" ".bib" == "file.bib"
 -- > addExtension "/" "x" == "/.x"
+-- > addExtension x "" == x
 -- > Valid x => takeFileName (addExtension (addTrailingPathSeparator x) "ext") == ".ext"
 -- > Windows: addExtension "\\\\share" ".txt" == "\\\\share\\.txt"
 addExtension :: FilePath -> String -> FilePath
diff --git a/changelog.md b/changelog.md
index eeee736..038f72e 100644
--- a/changelog.md
+++ b/changelog.md
@@ -2,6 +2,8 @@
 
 _Note: below all `FilePath` values are unquoted, so `\\` really means two backslashes._
 
+ * Documentation improvements
+
  * Allow QuickCheck-2.9
 
 ## 1.4.1.0  *Dec 2015*
diff --git a/tests/TestGen.hs b/tests/TestGen.hs
index e01a55d..848ae5b 100755
--- a/tests/TestGen.hs
+++ b/tests/TestGen.hs
@@ -96,6 +96,8 @@ tests =
     ,("W.addExtension \"file\" \".bib\" == \"file.bib\"", property $ W.addExtension "file" ".bib" == "file.bib")
     ,("P.addExtension \"/\" \"x\" == \"/.x\"", property $ P.addExtension "/" "x" == "/.x")
     ,("W.addExtension \"/\" \"x\" == \"/.x\"", property $ W.addExtension "/" "x" == "/.x")
+    ,("P.addExtension x \"\" == x", property $ \(QFilePath x) -> P.addExtension x "" == x)
+    ,("W.addExtension x \"\" == x", property $ \(QFilePath x) -> W.addExtension x "" == x)
     ,("P.takeFileName (P.addExtension (P.addTrailingPathSeparator x) \"ext\") == \".ext\"", property $ \(QFilePathValidP x) -> P.takeFileName (P.addExtension (P.addTrailingPathSeparator x) "ext") == ".ext")
     ,("W.takeFileName (W.addExtension (W.addTrailingPathSeparator x) \"ext\") == \".ext\"", property $ \(QFilePathValidW x) -> W.takeFileName (W.addExtension (W.addTrailingPathSeparator x) "ext") == ".ext")
     ,("W.addExtension \"\\\\\\\\share\" \".txt\" == \"\\\\\\\\share\\\\.txt\"", property $ W.addExtension "\\\\share" ".txt" == "\\\\share\\.txt")



More information about the ghc-commits mailing list