Elm Exactly
Results / elm-core /

StringStartsEndsTest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
Checks that `String.startsWith` and `String.endsWith` each give `True` for a matching prefix or suffix of `"Hello"` and `False` for one that is not.

Results

elm-0.19.1

passran in 51 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.
starts_yes: True
starts_no: False
ends_yes: True
ends_no: False

elm-0.19.2

passran in 35 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets.
starts_yes: True
starts_no: False
ends_yes: True
ends_no: False

elm-0.19.3

passran in 59 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets.
starts_yes: True
starts_no: False
ends_yes: True
ends_no: False

lamdera-1.5.0

passran in 57 ms
Output
starts_yes: True
starts_no: False
ends_yes: True
ends_no: False

Discussions

Discuss this test·Search the discussions on GitHub

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

Source

The -- CHECK: lines give the expected output.

module StringStartsEndsTest exposing (main)
{-| Checks that `String.startsWith` and `String.endsWith` each give `True` for a matching prefix or suffix of `"Hello"` and `False` for one that is not.
-}
-- CHECK: starts_yes: True
-- CHECK: starts_no: False
-- CHECK: ends_yes: True
-- CHECK: ends_no: False
import Html exposing (text)
main =
let
_ = Debug.log "starts_yes" (String.startsWith "He" "Hello")
_ = Debug.log "starts_no" (String.startsWith "lo" "Hello")
_ = Debug.log "ends_yes" (String.endsWith "lo" "Hello")
_ = Debug.log "ends_no" (String.endsWith "He" "Hello")
in
text "done"