@@ -14,6 +14,7 @@ import Data.Char (toUpper)
1414import Data.Maybe (fromMaybe)
1515import Data.Time (UTCTime)
1616import Data.Time.Format (parseTime)
17+import Data.Sequence (Seq)
1718import GHC.Generics (Generic)
1819import Test.Framework (Test, testGroup)
1920import Test.Framework.Providers.HUnit (testCase)
@@ -57,6 +58,7 @@ tests = testGroup "unit" [
5758 , testGroup ".:, .:?, .:!" $ fmap (testCase "-") dotColonMark
5859 , testGroup "To JSON representation" $ fmap (testCase "-") jsonEncoding
5960 , testGroup "From JSON representation" $ fmap (testCase "-") jsonDecoding
61+ , testGroup "JSONPath" $ fmap (testCase "-") jsonPath
6062 , testGroup "Issue #351" $ fmap (testCase "-") issue351
6163 ]
6264
@@ -231,6 +233,18 @@ jsonDecoding = [
231233 , assertEqual "Just Nothing" (Just Nothing :: Maybe (Maybe Int)) (decode "null")
232234 ]
233235
236+------------------------------------------------------------------------------
237+-- These tests check that JSONPath is tracked correctly
238+-----------------------------------------------------------------------------
239+
240+jsonPath :: [Assertion]
241+jsonPath = [
242+ -- issue #358
243+ assertEqual "Seq a"
244+ (Left "Error in $[2]: expected Int, encountered Boolean")
245+ (eitherDecode "[0,1,true]" :: Either String (Seq Int))
246+ ]
247+
234248------------------------------------------------------------------------------
235249-- Regressions
236250------------------------------------------------------------------------------