@@ -8,27 +8,26 @@ import ElmTest.Test (..)
88
99tests : Test
1010tests =
11− let isEmptyTests = suite "isEmpty Tests" [
12− test "empty is empty" <| assert <| isEmpty "",
13− test "not empty" <| assert <| not . isEmpty <| "the world"
14− ]
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 "")
21− ]
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/")
27− ]
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"])
31− ]
32−
33− endsWithTest = test "endsWith Check" (assert <| endsWith "h" "th")
34− in suite "String Tests" [isEmptyTests, lengthTest, reverseTest, repeatTest, unconsTests, appendTest, concatTest, splitTests, joinTests, endsWithTest]
11+ let simpleTests = suite "Simple Stuff"
12+ [ test "is empty" <| assert (isEmpty "")
13+ , test "is not empty" <| assert (not (isEmpty ("the world")))
14+ , test "length" <| assertEqual 11 (length "innumerable")
15+ , test "endsWith" (assert <| endsWith "ship" "spaceship")
16+ , test "reverse" <| assertEqual "desserts" (reverse "stressed")
17+ , test "repeat" <| assertEqual "hahaha" (repeat 3 "ha")
18+ ]
19+
20+ combiningTests = suite "Combining Strings"
21+ [ test "uncons non-empty" <| assertEqual (Just ('a',"bc")) (uncons "abc")
22+ , test "uncons empty" <| assertEqual Nothing (uncons "")
23+ , test "append 1" <| assertEqual "butterfly" (append "butter" "fly")
24+ , test "append 2" <| assertEqual "butter" (append "butter" "")
25+ , test "append 3" <| assertEqual "butter" (append "" "butter")
26+ , test "concat" <| assertEqual "nevertheless" (concat ["never","the","less"])
27+ , test "split commas" <| assertEqual ["cat","dog","cow"] (split "," "cat,dog,cow")
28+ , test "split slashes"<| assertEqual ["home","steve","Desktop", ""] (split "/" "home/steve/Desktop/")
29+ , test "join spaces" <| assertEqual "cat dog cow" (join " " ["cat","dog","cow"])
30+ , test "join slashes" <| assertEqual "home/steve/Desktop" (join "/" ["home","steve","Desktop"])
31+ ]
32+ in
33+ suite "String" [ simpleTests, combiningTests ]