Skip to content

Commit

Permalink
Fix tests for GHC < 9
Browse files Browse the repository at this point in the history
Reviewed By: helfper

Differential Revision: D62024746

fbshipit-source-id: 00d3a7657295307bdcfd5fe91d6472412a8f6c7a
  • Loading branch information
Simon Marlow authored and facebook-github-bot committed Aug 30, 2024
1 parent 0c39a98 commit 424f99b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion common/util/tests/JSONPrettyTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module JSONPrettyTest (main) where

import qualified Data.Aeson as Aeson
import qualified Data.ByteString.Lazy.Char8 as B
import Prettyprinter as Pretty hiding ((<>))
import Compat.Prettyprinter as Pretty hiding ((<>))
import Text.JSON

import Test.HUnit
Expand Down
5 changes: 5 additions & 0 deletions common/util/tests/ToExpTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
LICENSE file in the root directory of this source tree.
-}

{-# LANGUAGE CPP #-}
module ToExpTest where

import Test.HUnit
Expand Down Expand Up @@ -44,7 +45,11 @@ tests = TestList
-- the result is non-deterministic. Rather than add the
-- overhead of sorting the elements all the time, let's just
-- sort the test output.
#if MIN_VERSION_aeson(2,0,0)
(sort "Object (fromList [(fromText \"foo\", Number (-3)), (fromText \"bar\", Bool True)])")
#else
(sort "Object (HashMap.fromList [(\"foo\", Number (-3)), (\"bar\", Bool True)])")
#endif
(sort $ pp $ object
[ "foo" .= Number (-3)
, "bar" .= Bool True
Expand Down

0 comments on commit 424f99b

Please sign in to comment.