on master help sign in
Added tests for `needlePrefix` function.
1705455Ivan N. Veselov
tests/Hakyll/Core/Util/String/Tests.hs+10
@@ -28,6 +28,16 @@ tests = testGroup "Hakyll.Core.Util.String.Tests" $ concat
28 , fromAssertions "splitAll"
28 , fromAssertions "splitAll"
29 [ ["λ", "∀x.x", "hi"] @=? splitAll ", *" "λ, ∀x.x, hi"
29 [ ["λ", "∀x.x", "hi"] @=? splitAll ", *" "λ, ∀x.x, hi"
30 ]
30 ]
31+
32+ , fromAssertions "needlePrefix"
33+ [ "ab" @=? needlePrefix "cd" "abcde"
34+ , "xx" @=? needlePrefix "ab" "xxab"
35+ , "xx" @=? needlePrefix "a" "xx"
36+ , "x" @=? needlePrefix "ab" "xabxab"
37+ , "" @=? needlePrefix "ab" "abc"
38+ , "" @=? needlePrefix "ab" "abab"
39+ , "" @=? needlePrefix "" ""
40+ ]
31 ]
41 ]
32
42
33 where
43 where