File: Tests.hs

package info (click to toggle)
haskell-hakyll 3.2.7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 420 kB
  • sloc: haskell: 3,407; xml: 39; makefile: 5
file content (28 lines) | stat: -rw-r--r-- 577 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module Hakyll.Core.Util.String.Tests
    ( tests
    ) where

import Test.Framework (Test)
import Test.HUnit ((@=?))

import Hakyll.Core.Util.String
import TestSuite.Util

tests :: [Test]
tests = concat
    [ fromAssertions "trim"
        [ "foo" @=? trim " foo\n\t "
        ]

    , fromAssertions "replaceAll"
        [ "32 & 131" @=? replaceAll "0x[0-9]+" (show . readInt) "0x20 & 0x83"
        ]

    , fromAssertions "splitAll"
        [ ["λ", "∀x.x", "hi"] @=? splitAll ", *" "λ, ∀x.x,  hi"
        ]
    ]

  where
    readInt :: String -> Int
    readInt = read