@@ -38,6 +38,7 @@ import Test.Framework (Test, testGroup)
38import Test.Framework.Providers.HUnit (testCase)
38import Test.Framework.Providers.HUnit (testCase)
39import Test.HUnit (Assertion, assertFailure, assertEqual)
39import Test.HUnit (Assertion, assertFailure, assertEqual)
40import UnitTests.NullaryConstructors (nullaryConstructors)
40import UnitTests.NullaryConstructors (nullaryConstructors)
41+import Data.Word (Word8)
41import qualified Data.ByteString.Lazy.Char8 as L
42import qualified Data.ByteString.Lazy.Char8 as L
42import qualified Data.Text.Lazy.Builder as TLB
43import qualified Data.Text.Lazy.Builder as TLB
43import qualified Data.Text.Lazy.Encoding as TLE
44import qualified Data.Text.Lazy.Encoding as TLE
@@ -277,6 +278,13 @@ jsonDecodingExamples = [
277 Example "Nothing" "null" (Nothing :: Maybe Int)
278 Example "Nothing" "null" (Nothing :: Maybe Int)
278 , Example "Just" "1" (Just 1 :: Maybe Int)
279 , Example "Just" "1" (Just 1 :: Maybe Int)
279 , Example "Just Nothing" "null" (Nothing :: Maybe (Maybe Int))
280 , Example "Just Nothing" "null" (Nothing :: Maybe (Maybe Int))
281+ -- Integral values are truncated, and overflowed
282+ -- https://github.com/bos/aeson/issues/317
283+ , Example "Word8 3" "3" (Just 3 :: Maybe Word8)
284+ , Example "Word8 3.00" "3.00" (Just 3 :: Maybe Word8)
285+ , Example "Word8 3.14" "3.14" (Just 3 :: Maybe Word8) -- TODO: should be Nothing
286+ , Example "Word8 -1" "-1" (Just 255 :: Maybe Word8) -- TODO: should be Nothing
287+ , Example "Word8 300" "300" (Just 44 :: Maybe Word8) -- TODO: should be Nothing
282jsonExamples :: [Example]
290jsonExamples :: [Example]