Skip to content

Commit 2145c08

Browse files
Removed manual tests and haddock explanations
1 parent f7b03a6 commit 2145c08

File tree

2 files changed

+0
-25
lines changed

2 files changed

+0
-25
lines changed

System/FilePath/Internal.hs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -315,22 +315,11 @@ hasExtension = any isExtSeparator . takeFileName
315315

316316
-- | Does the given filename have the specified extension?
317317
--
318-
-- The extension may exclude the separator
319318
-- > "png" `isExtensionOf` "/directory/file.png" == True
320-
--
321-
-- And it may include it
322319
-- > ".png" `isExtensionOf` "/directory/file.png" == True
323-
--
324-
-- Multiple extensions are allowed
325320
-- > ".tar.gz" `isExtensionOf` "bar/foo.tar.gz" == True
326-
--
327-
-- But partial matches are not
328321
-- > "ar.gz" `isExtensionOf` "bar/foo.tar.gz" == False
329-
--
330-
-- Extensions are matched from the end, so the following yields @False@
331322
-- > "png" `isExtensionOf` "/directory/file.png.jpg" == False
332-
333-
-- The argument cannot simply be a suffix, it has to be to a valid extension
334323
-- > "csv/table.csv" `isExtensionOf` "/data/csv/table.csv" == False
335324
isExtensionOf :: String -> FilePath -> Bool
336325
isExtensionOf ext@('.':_) = isSuffixOf ext . takeExtensions

tests/TestGen.hs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -106,20 +106,6 @@ tests =
106106
,("W.hasExtension \"/directory/path.ext\" == True", property $ W.hasExtension "/directory/path.ext" == True)
107107
,("P.hasExtension \"/directory/path\" == False", property $ P.hasExtension "/directory/path" == False)
108108
,("W.hasExtension \"/directory/path\" == False", property $ W.hasExtension "/directory/path" == False)
109-
110-
,("W.isExtensionOf \"png\" \"/directory/file.png\" == True", property $ W.isExtensionOf "png" "/directory/file.png" == True)
111-
,("P.isExtensionOf \"png\" \"/directory/file.png\" == True", property $ W.isExtensionOf "png" "/directory/file.png" == True)
112-
,("W.isExtensionOf \".png\" \"/directory/file.png\" == True", property $ W.isExtensionOf ".png" "/directory/file.png" == True)
113-
,("P.isExtensionOf \".png\" \"/directory/file.png\" == True", property $ W.isExtensionOf ".png" "/directory/file.png" == True)
114-
,("W.isExtensionOf \".tar.gz\" \"bar/foo.tar.gz\" == True", property $ W.isExtensionOf ".tar.gz" "bar/foo.tar.gz" == True)
115-
,("P.isExtensionOf \".tar.gz\" \"bar/foo.tar.gz\" == True", property $ W.isExtensionOf ".tar.gz" "bar/foo.tar.gz" == True)
116-
,("W.isExtensionOf \"ar.gz\" \"bar/foo.tar.gz\" == False", property $ W.isExtensionOf "ar.gz" "bar/foo.tar.gz" == False)
117-
,("P.isExtensionOf \"ar.gz\" \"bar/foo.tar.gz\" == False", property $ W.isExtensionOf "ar.gz" "bar/foo.tar.gz" == False)
118-
,("W.isExtensionOf \"png\" \"/directory/file.png.jpg\" == False", property $ W.isExtensionOf "png" "/directory/file.png.jpg" == False)
119-
,("P.isExtensionOf \"png\" \"/directory/file.png.jpg\" == False", property $ W.isExtensionOf "png" "/directory/file.png.jpg" == False)
120-
,("W.isExtensionOf \"csv/table.csv\" \"/data/csv/table.csv\" == False", property $ W.isExtensionOf "csv/table.csv" "/data/csv/table.csv" == False)
121-
,("P.isExtensionOf \"csv/table.csv\" \"/data/csv/table.csv\" == False", property $ W.isExtensionOf "csv/table.csv" "/data/csv/table.csv" == False)
122-
123109
,("null (P.takeExtension x) == not (P.hasExtension x)", property $ \(QFilePath x) -> null (P.takeExtension x) == not (P.hasExtension x))
124110
,("null (W.takeExtension x) == not (W.hasExtension x)", property $ \(QFilePath x) -> null (W.takeExtension x) == not (W.hasExtension x))
125111
,("P.stripExtension \"hs.o\" \"foo.x.hs.o\" == Just \"foo.x\"", property $ P.stripExtension "hs.o" "foo.x.hs.o" == Just "foo.x")

0 commit comments

Comments
 (0)