#54, document the behaviour of <.> with an empty extension
authorNeil Mitchell <ndmitchell@gmail.com>
Mon, 14 Nov 2016 21:29:34 +0000 (21:29 +0000)
committerNeil Mitchell <ndmitchell@gmail.com>
Mon, 14 Nov 2016 21:29:34 +0000 (21:29 +0000)
System/FilePath/Internal.hs
changelog.md
tests/TestGen.hs

index df4b39c..4a376b3 100644 (file)
@@ -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
index eeee736..038f72e 100644 (file)
@@ -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*
index e01a55d..848ae5b 100755 (executable)
@@ -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")