@@ -0,0 +1,26 @@
1+module Test.String (tests) where
6+import ElmTest.Assertion (..)
7+import ElmTest.Test (..)
11+ let isEmptyTests = [test "empty is empty" <| assert <| isEmpty "",
12+ test "not empty" <| assert <| not . isEmpty <| "the world"]
13+ lengthTest = test "length of innumerable" <| assertEqual 11 (length "innumerable")
14+ reverseTest = test "reverse test" <| assertEqual "desserts" (reverse "stressed")
15+ repeatTest = test "repeat test" <| assertEqual "hahaha" (repeat 3 "ha")
16+ unconsTests = [test "nonempty uncons" <| assertEqual (Just ('a',"bc")) (uncons "abc"),
17+ test "empty uncons" <| assertEqual Nothing (uncons "")]
18+ appendTest = test "append test" <| assertEqual "butterfly" (append "butter" "fly")
19+ concatTest = test "concat test" <| assertEqual "nevertheless" (concat ["never","the","less"])
20+ splitTests = [test "split commas" <| assertEqual ["cat","dog","cow"] (split "," "cat,dog,cow"),
21+ test "split slashes"<| assertEqual ["home","evan","Desktop"] (split "/" "home/evan/Desktop/")]
22+ joinTests = [test "join spaces" <| assertEqual "cat dog cow" (join " " ["cat","dog","cow"]),
23+ test "join slashes" <| assertEqual "home/evan/Desktop" (join "/" ["home","evan","Desktop"])]
25+ endsWithTest = test "endsWith Check" (assert <| endsWith "h" "th")
26+ in List.concat [isEmptyTests, [lengthTest, reverseTest, repeatTest], unconsTests, [appendTest, concatTest], splitTests, joinTests, [endsWithTest]]