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 (24 lines) | stat: -rw-r--r-- 767 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
{-# LANGUAGE OverloadedStrings #-}
module Hakyll.Core.Routes.Tests
    ( tests
    ) where

import Test.Framework
import Test.HUnit hiding (Test)

import Hakyll.Core.Routes
import TestSuite.Util

tests :: [Test]
tests = fromAssertions "runRoutes"
    [ Just "foo.html" @=? runRoutes (setExtension "html") "foo"
    , Just "foo.html" @=? runRoutes (setExtension ".html") "foo"
    , Just "foo.html" @=? runRoutes (setExtension "html") "foo.markdown"
    , Just "foo.html" @=? runRoutes (setExtension ".html") "foo.markdown"

    , Just "tags/bar.xml" @=?
        runRoutes (gsubRoute "rss/" (const "")) "tags/rss/bar.xml"
    , Just "tags/bar.xml" @=?
        runRoutes (gsubRoute "rss/" (const "") `composeRoutes`
            setExtension "xml") "tags/rss/bar"
    ]