Elm Exactly
Results / elm-core /

StringAnyAllTest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
`String.any` and `String.all` with `Char.isDigit` give `True` and `False`
on strings with and without digits.

`any` is checked on `"abc123"` (`True`) and `"abcdef"` (`False`); `all` on
`"12345"` (`True`) and `"123abc"` (`False`).

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.
any_yes: True
any_no: False
all_yes: True
all_no: False

elm-0.19.2

passran in 44 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets.
any_yes: True
any_no: False
all_yes: True
all_no: False

elm-0.19.3

passran in 64 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets.
any_yes: True
any_no: False
all_yes: True
all_no: False

lamdera-1.5.0

passran in 51 ms
Output
any_yes: True
any_no: False
all_yes: True
all_no: False

Discussions

Discuss this test·Search the discussions on GitHub

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

Source

The -- CHECK: lines give the expected output.

module StringAnyAllTest exposing (main)
{-| `String.any` and `String.all` with `Char.isDigit` give `True` and `False`
on strings with and without digits.
`any` is checked on `"abc123"` (`True`) and `"abcdef"` (`False`); `all` on
`"12345"` (`True`) and `"123abc"` (`False`).
-}
-- CHECK: any_yes: True
-- CHECK: any_no: False
-- CHECK: all_yes: True
-- CHECK: all_no: False
import Html exposing (text)
main =
let
_ = Debug.log "any_yes" (String.any Char.isDigit "abc123")
_ = Debug.log "any_no" (String.any Char.isDigit "abcdef")
_ = Debug.log "all_yes" (String.all Char.isDigit "12345")
_ = Debug.log "all_no" (String.all Char.isDigit "123abc")
in
text "done"