Elm Exactly
Results /

elm-json

elm/json

Discussions of this project and its tests ↓

Showing 42 of 42 tests. Hover over a badge for the reason.

Testelm-0.19.1elm-0.19.2elm-0.19.3lamdera-1.5.0
DecodeArrayShapeTest
`Json.Decode.array` produces an `Array` that `Array.length`, `Array.get` and `==` treat like the one it was encoded from.
passpasspasspass
DecodeAtTest
`Json.Decode.at [ "a", "b" ]` follows nested object fields and decodes the value found there.
passpasspasspass
DecodeBoolTest
`Json.Decode.bool` decodes the JSON literals `true` and `false` to `True` and `False`.
passpasspasspass
DecodeFieldTest
`Json.Decode.field` decodes the named field of a JSON object.
passpasspasspass
DecodeFloatTest
`Json.Decode.float` decodes the JSON number `3.14` to the `Float` `3.14`.
passpasspasspass
DecodeIndexTest
`Json.Decode.index 1` decodes the second element of a JSON array.
passpasspasspass
DecodeIntTest
`Json.Decode.int` decodes the JSON number `42` to the `Int` `42`.
passpasspasspass
DecodeKeyValuePairsTest
`Json.Decode.keyValuePairs` decodes a JSON object to a list of (key, value) pairs, here in the order the keys appear in the input.
passpasspasspass
DecodeLargeArrayTest
Decoding long JSON arrays of integers gives the same elements, in order, through `Json.Decode.list`, `array`, `index`, `oneOf` and `value`, for arrays of 1,020 to 100,000 elements.
passpasspasspass
DecodeListTest
`Json.Decode.list` decodes a JSON array of numbers to a `List Int`.
passpasspasspass
DecodeNullTest
`Json.Decode.null 0` decodes the JSON literal `null` to the given value `0`.
passpasspasspass
DecodeStringTest
`Json.Decode.string` decodes a JSON string literal to the Elm `String` it contains.
passpasspasspass
DecodeSucceedFailTest
`Json.Decode.succeed 99` produces `99` whatever the input; here the input is `null`.
passpasspasspass
DecodeValueEncodeNullTest
Decoders given `Json.Encode.null` through `Json.Decode.decodeValue` treat it as JSON `null`.
passpasspasspass
EncodeCharTest
A list of `Char` encodes to JSON as an array of their integer code points when each element is encoded with `Json.Encode.int` of `Char.toCode`.
passpasspasspass
EncodeEmptyStringTest
`Json.Encode.string ""` encodes to the two-character JSON text `""`, and decoding that with `Json.Decode.string` gives back the empty string.
passpasspasspass
EncodeFloatTest
`Json.Encode.float` writes zero, positive, negative and small fractional values as the shortest JSON number text, and `1.5` survives a round trip through `Json.Decode.float`.
passpasspasspass
EncodeIntTest
`Json.Encode.int` encodes zero, positive and negative integers, including the 32-bit extremes 2147483647 and -2147483648, as plain decimal JSON numbers.
passpasspasspass
JsonDecodeArrayKindTest
`Json.Decode.array` with an element decoder built by `map` or `field` gives an Array of Ints, Floats or Chars that later Array operations read correctly.
passpasspasspass
JsonDecodeErrorTest
`Json.Decode` failures produce the right `Json.Decode.Error` value and the right `Json.Decode.errorToString` text.
passpasspasspass
JsonDecodeIntIntegralFloatTest
`Json.Decode.int` accepts a JSON number with a fraction or exponent when its value is a whole number, and rejects one that is not.
passpasspasspass
JsonDecodeLoneSurrogateTest
`Json.Decode.string` accepts a `\uXXXX` escape for a lone UTF-16 surrogate and keeps it as one code unit, while an escaped surrogate pair becomes one character.
passpasspasspass
JsonDecoderMixedValueFunctionCycleTest
A recursive `Json.Decode` decoder whose cycle runs through a top-level value and a top-level function decodes a nested tree correctly.
passpasspasspass
JsonDecoderSelfRecursiveNoLazyTest
A `Json.Decode` decoder that refers to itself without `Json.Decode.lazy` decodes a nested value correctly.
passpasspasspass
JsonDecoderSelfRecursiveTest
A `Json.Decode` decoder that refers to itself through `Json.Decode.lazy` decodes a nested value correctly.
passpasspasspass
JsonEncodeBigStringTest
Checks that `Json.Encode.string` encodes a 5000-character string as a quoted JSON string.
passpasspasspass
JsonEncodeFloatFormatTest
`Json.Encode.encode` writes a whole Float without a decimal point, uses exponent notation only for very large and very small magnitudes, and writes NaN and infinity as `null`.
passpasspasspass
JsonEncodeLoneSurrogateTest
`Json.Encode.encode` writes a lone UTF-16 surrogate in a string as a `\uXXXX` escape and leaves a valid surrogate pair unescaped.
passpasspasspass
JsonIssue18IndexNegativeTestelm19-bug
`Json.Decode.index` checks for an index past the end but not for a negative one.
failfailfailfail
JsonLargeUnsignedTest
JSON integers above 2^63 - 1 decode as the nearest Float rather than wrapping around to a negative number.
passpasspasspass
JsonObjectOrderTest
`Json.Encode` and `Json.Decode` keep an object's keys in JavaScript's order: insertion order, except that array-index keys come first in ascending numeric order.
passpasspasspass
RoundTripBoolTest
`True` and `False` encoded with `Json.Encode.bool` decode back to the same values with `Json.Decode.bool`.
passpasspasspass
RoundTripFloatTest
The float 3.14 encoded with `Json.Encode.float` decodes back to 3.14 with `Json.Decode.float`.
passpasspasspass
RoundTripIndexTest
`Json.Decode.index 1` reads the second element of a JSON array encoded from `[ "hello", "world" ]`.
passpasspasspass
RoundTripIntTest
The integer 42 encoded with `Json.Encode.int` decodes back to 42 with `Json.Decode.int`.
passpasspasspass
RoundTripKeyValuePairsTest
`Json.Decode.keyValuePairs` decodes an object encoded from `[ ( "a", 1 ), ( "b", 2 ) ]` back to the same pairs, in the same order.
passpasspasspass
RoundTripListTest
The list `[ 1, 2, 3 ]` encoded with `Json.Encode.list` decodes back to the same list with `Json.Decode.list`.
passpasspasspass
RoundTripNegativeIntTest
The negative integer -7 encoded with `Json.Encode.int` decodes back to -7 with `Json.Decode.int`.
passpasspasspass
RoundTripNestedTest
`Json.Decode.at [ "a", "b" ]` reads the integer 42 from an object nested inside another object.
passpasspasspass
RoundTripNullTest
`Json.Encode.null` decodes with `Json.Decode.null 0` to 0, the value passed to `null`.
passpasspasspass
RoundTripObjectTest
`Json.Decode.field "name"` reads the string "tom" from an object built with `Json.Encode.object`.
passpasspasspass
RoundTripStringTest
The string "hello" encoded with `Json.Encode.string` decodes back to "hello" with `Json.Decode.string`.
passpasspasspass

Discussions

Discuss this project·Search the discussions on GitHub

Discussions are on GitHub; one about this project has [p:elm-json] in its title.