File: Test.hs

package info (click to toggle)
haskell-raw-strings-qq 1.1-7
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 68 kB
  • sloc: haskell: 84; makefile: 3
file content (28 lines) | stat: -rw-r--r-- 564 bytes parent folder | download | duplicates (4)
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
{-# LANGUAGE QuasiQuotes #-}

module Main
       where

import Test.HUnit
import Text.RawString.QQ
import System.Exit

multilineUnixNewlines :: String
multilineUnixNewlines = [r|FOO
BAR|]

multilineWindowsNewlines :: String
multilineWindowsNewlines = [r|FOO
BAR|]

main :: IO ()
main = defaultMain $ test [
  "Windows newlines" ~: (multilineUnixNewlines ~=? multilineWindowsNewlines)
  ]

defaultMain :: Test -> IO ()
defaultMain t = do
  cnts <- runTestTT t
  case failures cnts + errors cnts of
    0 -> exitWith $ ExitSuccess
    n -> exitWith $ ExitFailure n