Elm Exactly
Results / elm-bytes /

EncodeSignedInt8Test

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
`Bytes.Encode.signedInt8` writes 1 byte for a negative value.

The test encodes `-42` and logs the width of the result.

Results

elm-0.19.1

passran in 48 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.
EncodeSignedInt8Test: 1

elm-0.19.2

passran in 53 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets.
EncodeSignedInt8Test: 1

elm-0.19.3

passran in 63 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets.
EncodeSignedInt8Test: 1

lamdera-1.5.0

passran in 55 ms
Output
EncodeSignedInt8Test: 1

Discussions

Discuss this test·Search the discussions on GitHub

Discussions are on GitHub; one about this test has [t:elm-bytes/EncodeSignedInt8Test] in its title.

Source

The -- CHECK: lines give the expected output.

module EncodeSignedInt8Test exposing (main)
{-| `Bytes.Encode.signedInt8` writes 1 byte for a negative value.
The test encodes `-42` and logs the width of the result.
-}
-- CHECK: EncodeSignedInt8Test: 1
import Bytes exposing (Bytes)
import Bytes.Encode as E
import Html exposing (text)
main =
let
bytes =
E.encode (E.signedInt8 -42)
result =
Bytes.width bytes
_ =
Debug.log "EncodeSignedInt8Test" result
in
text (String.fromInt result)