@@ -14,6 +14,7 @@ import Data.Char (toUpper)
14import Data.Maybe (fromMaybe)
14import Data.Maybe (fromMaybe)
15import Data.Time (UTCTime)
15import Data.Time (UTCTime)
16import Data.Time.Format (parseTime)
16import Data.Time.Format (parseTime)
17+import Data.Sequence (Seq)
17import GHC.Generics (Generic)
18import GHC.Generics (Generic)
18import Test.Framework (Test, testGroup)
19import Test.Framework (Test, testGroup)
19import Test.Framework.Providers.HUnit (testCase)
20import Test.Framework.Providers.HUnit (testCase)
@@ -57,6 +58,7 @@ tests = testGroup "unit" [
57 , testGroup ".:, .:?, .:!" $ fmap (testCase "-") dotColonMark
58 , testGroup ".:, .:?, .:!" $ fmap (testCase "-") dotColonMark
58 , testGroup "To JSON representation" $ fmap (testCase "-") jsonEncoding
59 , testGroup "To JSON representation" $ fmap (testCase "-") jsonEncoding
59 , testGroup "From JSON representation" $ fmap (testCase "-") jsonDecoding
60 , testGroup "From JSON representation" $ fmap (testCase "-") jsonDecoding
61+ , testGroup "JSONPath" $ fmap (testCase "-") jsonPath
60 , testGroup "Issue #351" $ fmap (testCase "-") issue351
62 , testGroup "Issue #351" $ fmap (testCase "-") issue351
@@ -231,6 +233,18 @@ jsonDecoding = [
231 , assertEqual "Just Nothing" (Just Nothing :: Maybe (Maybe Int)) (decode "null")
233 , assertEqual "Just Nothing" (Just Nothing :: Maybe (Maybe Int)) (decode "null")
236+------------------------------------------------------------------------------
237+-- These tests check that JSONPath is tracked correctly
238+-----------------------------------------------------------------------------
240+jsonPath :: [Assertion]
244+ (Left "Error in $[2]: expected Int, encountered Boolean")
245+ (eitherDecode "[0,1,true]" :: Either String (Seq Int))
234------------------------------------------------------------------------------
248------------------------------------------------------------------------------
235-- Regressions
249-- Regressions
236------------------------------------------------------------------------------
250------------------------------------------------------------------------------