Elm Exactly
Results / elm-bytes /

EncodeSignedInt32BETest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
`Bytes.Encode.signedInt32` with big-endian order writes 4 bytes for a negative value.

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

Results

elm-0.19.1

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

elm-0.19.2

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

elm-0.19.3

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

lamdera-1.5.0

passran in 55 ms
Output
EncodeSignedInt32BETest: 4

Discussions

Discuss this test·Search the discussions on GitHub

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

Source

The -- CHECK: lines give the expected output.

module EncodeSignedInt32BETest exposing (main)
{-| `Bytes.Encode.signedInt32` with big-endian order writes 4 bytes for a negative value.
The test encodes `-100000` and logs the width of the result.
-}
-- CHECK: EncodeSignedInt32BETest: 4
import Bytes exposing (Bytes, Endianness(..))
import Bytes.Encode as E
import Html exposing (text)
main =
let
bytes =
E.encode (E.signedInt32 BE -100000)
result =
Bytes.width bytes
_ =
Debug.log "EncodeSignedInt32BETest" result
in
text (String.fromInt result)