@@ -21,8 +21,9 @@ import qualified Data.Sequence as Seq
2121
2222tests :: Test
2323tests = testGroup "Error accumulation" [
24− testCase "seq" seq
25− , testCase "vector" vector
24+ testCase "Seq" seq
25+ , testCase "Vector" vector
26+ , testCase "NonEmpty" nonEmpty
2627 ]
2728
2829decoder :: FromJSON a
@@ -41,3 +42,9 @@ vector = do
4142 let res = decoder "[true, null]" :: Either (NonEmpty (JSONPath, String)) (Vector Int)
4243 let message i s = ([Index i], "expected Int, encountered " <> s)
4344 res @=? Left (NL.fromList [message 0 "Boolean", message 1 "Null"])
45+
46+nonEmpty :: Assertion
47+nonEmpty = do
48+ let res = decoder "[true, null]" :: Either (NonEmpty (JSONPath, String)) (NL.NonEmpty Int)
49+ let message i s = ([Index i], "expected Int, encountered " <> s)
50+ res @=? Left (NL.fromList [message 0 "Boolean", message 1 "Null"])