File: CallStackSpec.hs

package info (click to toggle)
haskell-call-stack 0.4.0-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 72 kB
  • sloc: haskell: 168; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 955 bytes parent folder | download | duplicates (3)
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
29
30
31
32
33
34
35
36
37
{-# LANGUAGE CPP #-}
module Data.CallStackSpec (spec) where

import           Test.Hspec
import           Util
import           Example

spec :: Spec
spec = do
  describe "callStack" $ do
    it "returns the call stack" $ do
      mapLocations test `shouldBe` [
#if MIN_VERSION_base(4,8,1)
          ("bar"
          , SrcLoc {
              srcLocPackage = "main"
            , srcLocModule = "Example"
            , srcLocFile = "test" </> "Example.hs"
            , srcLocStartLine = 18
            , srcLocStartCol = 7
            , srcLocEndLine = 18
            , srcLocEndCol = 10
            }
          )
        , ("foo"
          , SrcLoc {
              srcLocPackage = "main"
            , srcLocModule = "Example"
            , srcLocFile = "test" </> "Example.hs"
            , srcLocStartLine = 15
            , srcLocStartCol = 8
            , srcLocEndLine = 15
            , srcLocEndCol = 11
            }
          )
#endif
        ]