@@ -97,23 +97,16 @@ goldenWithHaskellDoc plugin title testDataDir path desc ext act =
97
97
documentContents doc
98
98
99
99
goldenWithHaskellDocFormatter
100
- :: PluginDescriptor IdeState
101
- -> String
102
- -> TestName
103
- -> FilePath
104
- -> FilePath
105
- -> FilePath
106
- -> FilePath
100
+ :: PluginDescriptor IdeState -- ^ Formatter plugin to be used
101
+ -> String -- ^ Name of the formatter to be used
102
+ -> TestName -- ^ Title of the test
103
+ -> FilePath -- ^ Directory of the test data to be used
104
+ -> FilePath -- ^ Path to the testdata to be used within the directory
105
+ -> FilePath -- ^ Additional suffix to be appended to the output file
106
+ -> FilePath -- ^ Extension of the output file
107
107
-> (TextDocumentIdentifier -> Session () )
108
108
-> TestTree
109
- goldenWithHaskellDocFormatter plugin formatter title testDataDir path desc ext act =
110
- goldenGitDiff title (testDataDir </> path <.> desc <.> ext)
111
- $ runSessionWithServerFormatter plugin formatter testDataDir
112
- $ TL. encodeUtf8 . TL. fromStrict
113
- <$> do
114
- doc <- openDoc (path <.> ext) " haskell"
115
- act doc
116
- documentContents doc
109
+ goldenWithHaskellDocFormatter = goldenWithDocFormatter " haskell"
117
110
118
111
runSessionWithServer :: PluginDescriptor IdeState -> FilePath -> Session a -> IO a
119
112
runSessionWithServer plugin = runSessionWithServer' [plugin] def def fullCaps
@@ -127,21 +120,34 @@ runSessionWithServerFormatter plugin formatter =
127
120
fullCaps
128
121
129
122
goldenWithCabalDocFormatter
130
- :: PluginDescriptor IdeState
131
- -> String
132
- -> TestName
133
- -> FilePath
134
- -> FilePath
135
- -> FilePath
136
- -> FilePath
123
+ :: PluginDescriptor IdeState -- ^ Formatter plugin to be used
124
+ -> String -- ^ Name of the formatter to be used
125
+ -> TestName -- ^ Title of the test
126
+ -> FilePath -- ^ Directory of the test data to be used
127
+ -> FilePath -- ^ Path to the testdata to be used within the directory
128
+ -> FilePath -- ^ Additional suffix to be appended to the output file
129
+ -> FilePath -- ^ Extension of the output file
130
+ -> (TextDocumentIdentifier -> Session () )
131
+ -> TestTree
132
+ goldenWithCabalDocFormatter = goldenWithDocFormatter " cabal"
133
+
134
+ goldenWithDocFormatter
135
+ :: T. Text -- ^ Type of the document to open
136
+ -> PluginDescriptor IdeState -- ^ Formatter plugin to be used
137
+ -> String -- ^ Name of the formatter to be used
138
+ -> TestName -- ^ Title of the test
139
+ -> FilePath -- ^ Directory of the test data to be used
140
+ -> FilePath -- ^ Path to the testdata to be used within the directory
141
+ -> FilePath -- ^ Additional suffix to be appended to the output file
142
+ -> FilePath -- ^ Extension of the output file
137
143
-> (TextDocumentIdentifier -> Session () )
138
144
-> TestTree
139
- goldenWithCabalDocFormatter plugin formatter title testDataDir path desc ext act =
145
+ goldenWithDocFormatter filetype plugin formatter title testDataDir path desc ext act =
140
146
goldenGitDiff title (testDataDir </> path <.> desc <.> ext)
141
147
$ runSessionWithServerFormatter plugin formatter testDataDir
142
148
$ TL. encodeUtf8 . TL. fromStrict
143
149
<$> do
144
- doc <- openDoc (path <.> ext) " cabal "
150
+ doc <- openDoc (path <.> ext) filetype
145
151
act doc
146
152
documentContents doc
147
153
0 commit comments