File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import Data.Attoparsec.Text
8
8
import Data.Char (isSpace )
9
9
import Data.Text (Text )
10
10
import qualified Data.Text as T
11
+ import Debug.Trace
11
12
12
13
type Name = Text
13
14
@@ -45,8 +46,11 @@ parsePackage =
45
46
46
47
componentHeader :: Indent -> Text -> Parser Name
47
48
componentHeader i t = do
49
+ traceM $ " indent" <> show i
48
50
indent i
51
+ traceM $ " asciiCI" <> T. unpack t
49
52
_ <- asciiCI t
53
+ traceM " parseString"
50
54
skipMany tabOrSpace
51
55
n <- parseString <|> pure " "
52
56
skipToNextLine
Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ spec = do
26
26
$ it " successfully parses library section"
27
27
$ libSection ~> parseLib 0
28
28
`shouldParse` Lib " " " src"
29
+ describe " Should Succeed"
30
+ $ it " successfully parses bench section"
31
+ $ benchSection ~> parseBench 0
32
+ `shouldParse` Bench " folds" " benchmarks/folds.hs"
29
33
describe " Should Succeed"
30
34
$ it " successfully parses package"
31
35
$ fullFile ~> parsePackage
@@ -57,23 +61,23 @@ fullFile = "name: implicit-hie\n" <> libSection <> exeSection <> testSection
57
61
exeSection :: Text
58
62
exeSection =
59
63
" executable implicit-hie-exe\n \
60
- \ main-is: Main.hs \n \
61
64
\ other-modules:\n \
62
65
\ Paths_implicit_hie\n \
63
66
\ hs-source-dirs:\n \
64
67
\ app\n \
65
- \ ghc-options: -O2\n "
68
+ \ ghc-options: -O2\n \
69
+ \ main-is: Main.hs \n "
66
70
67
71
testSection :: Text
68
72
testSection =
69
73
" test-suite implicit-hie-test\n \
70
74
\ type: exitcode-stdio-1.0\n \
71
- \ main-is: Spec.hs\n \
72
75
\ other-modules:\n \
73
76
\ Paths_implicit_hie\n \
74
77
\ hs-source-dirs:\n \
75
78
\ test\n \
76
79
\ ghc-options: -fspecialize-aggressively -Wall -Wincomplete-record-updates -Wincomplete-uni-patterns -fno-warn-unused-imports -fno-warn-unused-binds -fno-warn-name-shadowing -fwarn-redundant-constraints -threaded -rtsopts -with-rtsopts=-N\n \
80
+ \ main-is: Spec.hs\n \
77
81
\ build-depends:\n \
78
82
\ attoparsec\n \
79
83
\ , base >=4.7 && <5\n \
@@ -100,6 +104,15 @@ libSection =
100
104
\ default-language: Haskell2010\n \
101
105
\"
102
106
107
+ benchSection :: Text
108
+ benchSection =
109
+ " benchmark folds\n \
110
+ \ default-language: Haskell2010\n \
111
+ \ hs-source-dirs: benchmarks\n \
112
+ \ ghc-options: -Wall -threaded\n \
113
+ \ type: exitcode-stdio-1.0\n \
114
+ \ main-is: folds.hs\n "
115
+
103
116
stackHie :: Text
104
117
stackHie =
105
118
" cradle:\n \
You can’t perform that action at this time.
0 commit comments