on master help sign in
Add #317 tests, documents current behaviour
commitbb0260148c0e51bb604e279cab9d9a3a70247ee4 authorOleg Grenrus <oleg.grenrus@iki.fi> dateTue 14 Jun 2016, 08:31 (10 years ago) parent2081a14
1 file changed+8
tests/UnitTests.hs+8
tests/UnitTests.hs+8
@@ -38,6 +38,7 @@ import Test.Framework (Test, testGroup)
3838import Test.Framework.Providers.HUnit (testCase)
3939import Test.HUnit (Assertion, assertFailure, assertEqual)
4040import UnitTests.NullaryConstructors (nullaryConstructors)
41+import Data.Word (Word8)
4142import qualified Data.ByteString.Lazy.Char8 as L
4243import qualified Data.Text.Lazy.Builder as TLB
4344import qualified Data.Text.Lazy.Encoding as TLE
@@ -277,6 +278,13 @@ jsonDecodingExamples = [
277278 Example "Nothing" "null" (Nothing :: Maybe Int)
278279 , Example "Just" "1" (Just 1 :: Maybe Int)
279280 , 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
280288 ]
281289
282290jsonExamples :: [Example]