mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-07 21:41:34 -07:00
Simplify mockedSystemInterface
This commit is contained in:
parent
42abcb7ae2
commit
85c49a8af9
1 changed files with 4 additions and 4 deletions
|
@ -316,10 +316,10 @@ mockedSystemInterface files = SystemInterface {
|
|||
siGetConfig = const $ return Nothing
|
||||
}
|
||||
where
|
||||
rf file =
|
||||
case filter ((== file) . fst) files of
|
||||
[] -> return $ Left "File not included in mock."
|
||||
[(_, contents)] -> return $ Right contents
|
||||
rf file = return $
|
||||
case find ((== file) . fst) files of
|
||||
Nothing -> Left "File not included in mock."
|
||||
Just (_, contents) -> Right contents
|
||||
fs _ _ file = return file
|
||||
|
||||
mockRcFile rcfile mock = mock {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue