mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-08 11:14:25 +08:00
Simplify mockedSystemInterface
This commit is contained in:
@@ -316,10 +316,10 @@ mockedSystemInterface files = SystemInterface {
|
|||||||
siGetConfig = const $ return Nothing
|
siGetConfig = const $ return Nothing
|
||||||
}
|
}
|
||||||
where
|
where
|
||||||
rf file =
|
rf file = return $
|
||||||
case filter ((== file) . fst) files of
|
case find ((== file) . fst) files of
|
||||||
[] -> return $ Left "File not included in mock."
|
Nothing -> Left "File not included in mock."
|
||||||
[(_, contents)] -> return $ Right contents
|
Just (_, contents) -> Right contents
|
||||||
fs _ _ file = return file
|
fs _ _ file = return file
|
||||||
|
|
||||||
mockRcFile rcfile mock = mock {
|
mockRcFile rcfile mock = mock {
|
||||||
|
Reference in New Issue
Block a user