diff options
| author | Joey Hess <joey@kitenet.net> | 2014-07-17 23:32:29 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-07-17 23:33:10 -0400 |
| commit | 55a638ad4c7605041ece96843a1d608d40c2984d (patch) | |
| tree | 2ff6abb26da843c8ec22b64d8b7fe7d984093653 /src/Propellor/Property/File.hs | |
| parent | c65e9adc7f2cbd80df3f58f188a8efa9bdf42b45 (diff) | |
Fix bug in File.containsLines that caused lines that were already in the file to sometimes be appended to the end.
Diffstat (limited to 'src/Propellor/Property/File.hs')
| -rw-r--r-- | src/Propellor/Property/File.hs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/Propellor/Property/File.hs b/src/Propellor/Property/File.hs index 07ac8c26..bc499e07 100644 --- a/src/Propellor/Property/File.hs +++ b/src/Propellor/Property/File.hs @@ -41,11 +41,9 @@ containsLine :: FilePath -> Line -> Property f `containsLine` l = f `containsLines` [l] containsLines :: FilePath -> [Line] -> Property -f `containsLines` l = fileProperty (f ++ " contains:" ++ show l) go f +f `containsLines` ls = fileProperty (f ++ " contains:" ++ show ls) go f where - go ls - | all (`elem` ls) l = ls - | otherwise = ls++l + go content = content ++ filter (`notElem` content) ls -- | Ensures that a line is not present in a file. -- Note that the file is ensured to exist, so if it doesn't, an empty |
