Skip to content

Commit

Permalink
Get rid of a warning, make tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Aug 9, 2018
1 parent 4f6c663 commit 71c79e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions subs/pantry/src/Pantry/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,7 @@ instance FromJSON (WithJSONWarnings UnresolvedPackageLocationImmutable) where
-- if subdirs exists, it needs to be valid
case HM.lookup "subdirs" o of
Just v' -> do
tellJSONField "subdirs"
subdirs <- lift $ parseJSON v'
case subdirs of
[] -> fail "Invalid empty subdirs"
Expand Down
4 changes: 2 additions & 2 deletions subs/pantry/test/Pantry/BuildPlanSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ spec =
describe "PackageLocation" $ do
describe "Archive" $ do
describe "github" $ do
let decode' :: MonadThrow m => ByteString -> m (WithJSONWarnings UnresolvedPackageLocationImmutable)
let decode' :: (HasCallStack, MonadThrow m) => ByteString -> m (WithJSONWarnings UnresolvedPackageLocationImmutable)
decode' = decodeThrow

decode'' :: ByteString -> IO [PackageLocationImmutable]
decode'' :: HasCallStack => ByteString -> IO [PackageLocationImmutable]
decode'' bs = do
WithJSONWarnings unresolved warnings <- decode' bs
unless (null warnings) $ error $ show warnings
Expand Down

0 comments on commit 71c79e4

Please sign in to comment.