Elm Exactly
Results / elm-bytes /

EncodeUnsignedInt32LETest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
`Bytes.Encode.unsignedInt32` with little-endian order writes 4 bytes.

The test encodes `0x12345678` and logs the width of the result.

Results

elm-0.19.1

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

elm-0.19.2

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

elm-0.19.3

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

lamdera-1.5.0

passran in 57 ms
Output
EncodeUnsignedInt32LETest: 4

Discussions

Discuss this test·Search the discussions on GitHub

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

Source

The -- CHECK: lines give the expected output.

module EncodeUnsignedInt32LETest exposing (main)
{-| `Bytes.Encode.unsignedInt32` with little-endian order writes 4 bytes.
The test encodes `0x12345678` and logs the width of the result.
-}
-- CHECK: EncodeUnsignedInt32LETest: 4
import Bytes exposing (Bytes, Endianness(..))
import Bytes.Encode as E
import Html exposing (text)
main =
let
bytes =
E.encode (E.unsignedInt32 LE 0x12345678)
result =
Bytes.width bytes
_ =
Debug.log "EncodeUnsignedInt32LETest" result
in
text (String.fromInt result)