EncodeUnsignedInt8MaxTest
`Bytes.Encode.unsignedInt8` writes 1 byte for its largest value, 255. The test logs the width of the result.
Results
elm-0.19.1
passran in 56 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. EncodeUnsignedInt8MaxTest: 1
elm-0.19.2
passran in 45 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. EncodeUnsignedInt8MaxTest: 1
elm-0.19.3
passran in 41 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. EncodeUnsignedInt8MaxTest: 1
lamdera-1.5.0
passran in 59 msOutput
EncodeUnsignedInt8MaxTest: 1
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-bytes/EncodeUnsignedInt8MaxTest] in its title.
Source
The -- CHECK: lines give the expected output.
module EncodeUnsignedInt8MaxTest exposing (main)
{-| `Bytes.Encode.unsignedInt8` writes 1 byte for its largest value, 255.
The test logs the width of the result.
-}
-- CHECK: EncodeUnsignedInt8MaxTest: 1
import Bytes exposing (Bytes)
import Bytes.Encode as E
import Html exposing (text)
main =
let
bytes =
E.encode (E.unsignedInt8 255)
result =
Bytes.width bytes
_ =
Debug.log "EncodeUnsignedInt8MaxTest" result
in
text (String.fromInt result)