Skip to content

Commit d750e79

Browse files
committed
hls-notes-plugin: Fix tests after #3846, add CI job
1 parent 139717f commit d750e79

File tree

2 files changed

+42
-39
lines changed

2 files changed

+42
-39
lines changed

.github/workflows/test.yml

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
- ubuntu-latest
7575
- macOS-latest
7676
- windows-latest
77-
test:
77+
test:
7878
- true
7979
- false
8080
exclude:
@@ -112,140 +112,143 @@ jobs:
112112
113113
- if: matrix.test
114114
name: Test hls-graph
115-
run: cabal test hls-graph
115+
run: cabal test hls-graph
116116

117117
- if: needs.pre_job.outputs.should_skip_ghcide != 'true' && matrix.test
118118
name: Test ghcide
119119
# run the tests without parallelism to avoid running out of memory
120-
run: cabal test ghcide || cabal test ghcide
120+
run: cabal test ghcide || cabal test ghcide
121121

122122
- if: matrix.test
123123
name: Test hls-plugin-api
124-
run: cabal test hls-plugin-api || cabal test hls-plugin-api
124+
run: cabal test hls-plugin-api || cabal test hls-plugin-api
125125

126126
- if: matrix.test
127127
name: Test func-test suite
128128
env:
129129
HLS_TEST_EXE: hls
130130
HLS_WRAPPER_TEST_EXE: hls-wrapper
131-
run: cabal test func-test || cabal test func-test
131+
run: cabal test func-test || cabal test func-test
132132

133133
- if: matrix.test
134134
name: Test wrapper-test suite
135135
env:
136136
HLS_TEST_EXE: hls
137137
HLS_WRAPPER_TEST_EXE: hls-wrapper
138-
run: cabal test wrapper-test
138+
run: cabal test wrapper-test
139139

140140
- if: matrix.test
141141
name: Test hls-refactor-plugin
142-
run: cabal test hls-refactor-plugin-tests || cabal test hls-refactor-plugin-tests
142+
run: cabal test hls-refactor-plugin-tests || cabal test hls-refactor-plugin-tests
143143

144-
- if: matrix.test
144+
- if: matrix.test
145145
name: Test hls-floskell-plugin
146-
run: cabal test hls-floskell-plugin-tests || cabal test hls-floskell-plugin-tests
146+
run: cabal test hls-floskell-plugin-tests || cabal test hls-floskell-plugin-tests
147147

148148
- if: matrix.test
149149
name: Test hls-class-plugin
150-
run: cabal test hls-class-plugin-tests || cabal test hls-class-plugin-tests
150+
run: cabal test hls-class-plugin-tests || cabal test hls-class-plugin-tests
151151

152152
- if: matrix.test
153153
name: Test hls-pragmas-plugin
154-
run: cabal test hls-pragmas-plugin-tests || cabal test hls-pragmas-plugin-tests
154+
run: cabal test hls-pragmas-plugin-tests || cabal test hls-pragmas-plugin-tests
155155

156156
- if: matrix.test
157157
name: Test hls-eval-plugin
158-
run: cabal test hls-eval-plugin-tests || cabal test hls-eval-plugin-tests
158+
run: cabal test hls-eval-plugin-tests || cabal test hls-eval-plugin-tests
159159

160160
- if: matrix.test
161161
name: Test hls-splice-plugin
162-
run: cabal test hls-splice-plugin-tests || cabal test hls-splice-plugin-tests
162+
run: cabal test hls-splice-plugin-tests || cabal test hls-splice-plugin-tests
163163

164164
- if: matrix.test && matrix.ghc != '9.2'
165165
name: Test hls-stan-plugin
166-
run: cabal test hls-stan-plugin-tests || cabal test hls-stan-plugin-tests
166+
run: cabal test hls-stan-plugin-tests || cabal test hls-stan-plugin-tests
167167

168168
- if: matrix.test
169169
name: Test hls-stylish-haskell-plugin
170-
run: cabal test hls-stylish-haskell-plugin-tests || cabal test hls-stylish-haskell-plugin-tests
170+
run: cabal test hls-stylish-haskell-plugin-tests || cabal test hls-stylish-haskell-plugin-tests
171171

172-
- if: matrix.test
172+
- if: matrix.test
173173
name: Test hls-ormolu-plugin
174-
run: cabal test hls-ormolu-plugin-tests || cabal test hls-ormolu-plugin-tests
174+
run: cabal test hls-ormolu-plugin-tests || cabal test hls-ormolu-plugin-tests
175175

176-
- if: matrix.test
176+
- if: matrix.test
177177
name: Test hls-fourmolu-plugin
178-
run: cabal test hls-fourmolu-plugin-tests || cabal test hls-fourmolu-plugin-tests
178+
run: cabal test hls-fourmolu-plugin-tests || cabal test hls-fourmolu-plugin-tests
179179

180180
- if: matrix.test
181181
name: Test hls-explicit-imports-plugin test suite
182-
run: cabal test hls-explicit-imports-plugin-tests || cabal test hls-explicit-imports-plugin-tests
182+
run: cabal test hls-explicit-imports-plugin-tests || cabal test hls-explicit-imports-plugin-tests
183183

184184
- if: matrix.test
185185
name: Test hls-call-hierarchy-plugin test suite
186-
run: cabal test hls-call-hierarchy-plugin-tests || cabal test hls-call-hierarchy-plugin-tests
186+
run: cabal test hls-call-hierarchy-plugin-tests || cabal test hls-call-hierarchy-plugin-tests
187187

188188
- if: matrix.test && matrix.os != 'windows-latest'
189189
name: Test hls-rename-plugin test suite
190-
run: cabal test hls-rename-plugin-tests || cabal test hls-rename-plugin-tests
190+
run: cabal test hls-rename-plugin-tests || cabal test hls-rename-plugin-tests
191191

192-
- if: matrix.test
192+
- if: matrix.test
193193
name: Test hls-hlint-plugin test suite
194-
run: cabal test hls-hlint-plugin-tests || cabal test hls-hlint-plugin-tests
194+
run: cabal test hls-hlint-plugin-tests || cabal test hls-hlint-plugin-tests
195195

196196
- if: matrix.test
197197
name: Test hls-module-name-plugin test suite
198-
run: cabal test hls-module-name-plugin-tests || cabal test hls-module-name-plugin-tests
198+
run: cabal test hls-module-name-plugin-tests || cabal test hls-module-name-plugin-tests
199199

200200
- if: matrix.test
201201
name: Test hls-alternate-number-format-plugin test suite
202-
run: cabal test hls-alternate-number-format-plugin-tests || cabal test hls-alternate-number-format-plugin-tests
202+
run: cabal test hls-alternate-number-format-plugin-tests || cabal test hls-alternate-number-format-plugin-tests
203203

204204
- if: matrix.test
205205
name: Test hls-qualify-imported-names-plugin test suite
206-
run: cabal test hls-qualify-imported-names-plugin-tests || cabal test hls-qualify-imported-names-plugin-tests
206+
run: cabal test hls-qualify-imported-names-plugin-tests || cabal test hls-qualify-imported-names-plugin-tests
207207

208208
- if: matrix.test
209209
name: Test hls-code-range-plugin test suite
210-
run: cabal test hls-code-range-plugin-tests || cabal test hls-code-range-plugin-tests
210+
run: cabal test hls-code-range-plugin-tests || cabal test hls-code-range-plugin-tests
211211

212212
- if: matrix.test
213213
name: Test hls-change-type-signature test suite
214-
run: cabal test hls-change-type-signature-plugin-tests || cabal test hls-change-type-signature-plugin-tests
214+
run: cabal test hls-change-type-signature-plugin-tests || cabal test hls-change-type-signature-plugin-tests
215215

216216
- if: matrix.test
217217
name: Test hls-gadt-plugin test suit
218-
run: cabal test hls-gadt-plugin-tests || cabal test hls-gadt-plugin-tests
218+
run: cabal test hls-gadt-plugin-tests || cabal test hls-gadt-plugin-tests
219219

220220
- if: matrix.test
221221
name: Test hls-explicit-fixity-plugin test suite
222-
run: cabal test hls-explicit-fixity-plugin-tests || cabal test hls-explicit-fixity-plugin-tests
222+
run: cabal test hls-explicit-fixity-plugin-tests || cabal test hls-explicit-fixity-plugin-tests
223223

224224
- if: matrix.test
225225
name: Test hls-explicit-record-fields-plugin test suite
226-
run: cabal test hls-explicit-record-fields-plugin-tests || cabal test hls-explicit-record-fields-plugin-tests
226+
run: cabal test hls-explicit-record-fields-plugin-tests || cabal test hls-explicit-record-fields-plugin-tests
227227

228228
## version needs to be limited since the tests depend on cabal-fmt which only builds using specific ghc versions
229229
- if: matrix.test && matrix.ghc == '9.2'
230230
name: Test hls-cabal-fmt-plugin test suite
231-
run: cabal test hls-cabal-fmt-plugin-tests --flag=isolateCabalfmtTests || cabal test hls-cabal-fmt-plugin-tests --flag=isolateCabalfmtTests
231+
run: cabal test hls-cabal-fmt-plugin-tests --flag=isolateCabalfmtTests || cabal test hls-cabal-fmt-plugin-tests --flag=isolateCabalfmtTests
232232

233233
- if: matrix.test
234234
name: Test hls-cabal-plugin test suite
235-
run: cabal test hls-cabal-plugin-tests || cabal test hls-cabal-plugin-tests
235+
run: cabal test hls-cabal-plugin-tests || cabal test hls-cabal-plugin-tests
236236

237237
- if: matrix.test
238238
name: Test hls-retrie-plugin test suite
239-
run: cabal test hls-retrie-plugin-tests || cabal test hls-retrie-plugin-tests
239+
run: cabal test hls-retrie-plugin-tests || cabal test hls-retrie-plugin-tests
240240

241241
- if: matrix.test
242242
name: Test hls-overloaded-record-dot-plugin test suite
243-
run: cabal test hls-overloaded-record-dot-plugin-tests || cabal test hls-overloaded-record-dot-plugin-tests
243+
run: cabal test hls-overloaded-record-dot-plugin-tests || cabal test hls-overloaded-record-dot-plugin-tests
244244

245245
- if: matrix.test
246246
name: Test hls-semantic-tokens-plugin test suite
247-
run: cabal test hls-semantic-tokens-plugin-tests || cabal test hls-semantic-tokens-plugin-tests
247+
run: cabal test hls-semantic-tokens-plugin-tests || cabal test hls-semantic-tokens-plugin-tests
248248

249+
- if: matrix.test
250+
name: Test hls-notes-plugin test suite
251+
run: cabal test hls-notes-plugin-tests || cabal test hls-notes-plugin-tests
249252

250253
test_post_job:
251254
if: always()

plugins/hls-notes-plugin/test/NotesTest.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ gotoNoteTests = testGroup "Goto Note Definition"
2323
defs <- getDefinitions doc (Position 3 41)
2424
liftIO $ do
2525
fp <- canonicalizePath "NoteDef.hs"
26-
defs @?= InL (Definition (InL (Location (filePathToUri fp) (Range (Position 5 9) (Position 5 9)))))
26+
defs @?= InL (Definition (InR [Location (filePathToUri fp) (Range (Position 5 9) (Position 5 9))]))
2727
, testCase "no_note" $ runSessionWithServer def plugin testDataDir $ do
2828
doc <- openDoc "NoteDef.hs" "haskell"
2929
defs <- getDefinitions doc (Position 1 0)
@@ -36,7 +36,7 @@ gotoNoteTests = testGroup "Goto Note Definition"
3636
defs <- getDefinitions doc (Position 5 20)
3737
liftIO $ do
3838
fp <- canonicalizePath "NoteDef.hs"
39-
defs @?= InL (Definition (InL (Location (filePathToUri fp) (Range (Position 9 6) (Position 9 6)))))
39+
defs @?= InL (Definition (InR [Location (filePathToUri fp) (Range (Position 9 6) (Position 9 6))]))
4040
]
4141

4242
testDataDir :: FilePath

0 commit comments

Comments
 (0)