EncodeSequenceEmptyTest
`Bytes.Encode.sequence []` produces zero bytes. The test logs the width of the encoded empty sequence.
Results
elm-0.19.1
passran in 52 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. EncodeSequenceEmptyTest: 0
elm-0.19.2
passran in 67 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. EncodeSequenceEmptyTest: 0
elm-0.19.3
passran in 57 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. EncodeSequenceEmptyTest: 0
lamdera-1.5.0
passran in 57 msOutput
EncodeSequenceEmptyTest: 0
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-bytes/EncodeSequenceEmptyTest] in its title.
Source
The -- CHECK: lines give the expected output.
module EncodeSequenceEmptyTest exposing (main)
{-| `Bytes.Encode.sequence []` produces zero bytes.
The test logs the width of the encoded empty sequence.
-}
-- CHECK: EncodeSequenceEmptyTest: 0
import Bytes exposing (Bytes)
import Bytes.Encode as E
import Html exposing (text)
main =
let
bytes =
E.encode (E.sequence [])
result =
Bytes.width bytes
_ =
Debug.log "EncodeSequenceEmptyTest" result
in
text (String.fromInt result)