elm/exercises/pangram/PangramTests.elm

71 lines
1.6 KiB
Elm
Raw Normal View History

module Main exposing (..)
2016-03-14 00:15:06 +00:00
import ElmTest exposing (..)
import Pangram exposing (isPangram)
tests : Test
tests =
suite
"Pangram"
[ test
"sentence empty"
(assertEqual
False
(isPangram "")
)
, test
"pangram with only lower case"
(assertEqual
True
(isPangram "the quick brown fox jumps over the lazy dog")
)
, test
"missing character 'x'"
(assertEqual
False
(isPangram "a quick movement of the enemy will jeopardize five gunboats")
)
2016-06-17 01:31:54 +00:00
, test
"another missing character 'x'"
(assertEqual
False
(isPangram "the quick brown fish jumps over the lazy dog")
)
, test
"pangram with underscores"
(assertEqual
True
(isPangram "the_quick_brown_fox_jumps_over_the_lazy_dog")
)
, test
"pangram with numbers"
(assertEqual
True
(isPangram "the 1 quick brown fox jumps over the 2 lazy dogs")
)
, test
"missing letters replaced by numbers"
(assertEqual
False
(isPangram "7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog")
)
2016-03-14 00:15:06 +00:00
, test
"pangram with mixed case and punctuation"
(assertEqual
True
(isPangram "\"Five quacking Zephyrs jolt my wax bed.\"")
)
, test
"pangram with non ascii characters"
(assertEqual
True
(isPangram "Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich.")
)
]
main : Program Never
main =
runSuite tests