1module Test.String (tests) where
6import ElmTest.Assertion (..)
7import ElmTest.Test (..)
11 let isEmptyTests = suite "isEmpty Tests" [
12 test "empty is empty" <| assert <| isEmpty "",
13 test "not empty" <| assert <| not . isEmpty <| "the world"
15 lengthTest = test "length of innumerable" <| assertEqual 11 (length "innumerable")
16 reverseTest = test "reverse test" <| assertEqual "desserts" (reverse "stressed")
17 repeatTest = test "repeat test" <| assertEqual "hahaha" (repeat 3 "ha")
18 unconsTests = suite "uncons Tests" [
19 test "nonempty uncons" <| assertEqual (Just ('a',"bc")) (uncons "abc"),
20 test "empty uncons" <| assertEqual Nothing (uncons "")
22 appendTest = test "append test" <| assertEqual "butterfly" (append "butter" "fly")
23 concatTest = test "concat test" <| assertEqual "nevertheless" (concat ["never","the","less"])
24 splitTests = suite "split Tests" [
25 test "split commas" <| assertEqual ["cat","dog","cow"] (split "," "cat,dog,cow"),
26 test "split slashes"<| assertEqual ["home","evan","Desktop", ""] (split "/" "home/evan/Desktop/")
28 joinTests = suite "join Tests" [
29 test "join spaces" <| assertEqual "cat dog cow" (join " " ["cat","dog","cow"]),
30 test "join slashes" <| assertEqual "home/evan/Desktop" (join "/" ["home","evan","Desktop"])
33 endsWithTest = test "endsWith Check" (assert <| endsWith "h" "th")
34 in suite "String Tests" [isEmptyTests, lengthTest, reverseTest, repeatTest, unconsTests, appendTest, concatTest, splitTests, joinTests, endsWithTest]
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list