this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

cue/format: add test for issue #4238

The formatter incorrectly places commas after inline comments in list
elements with ellipsis, e.g. `...string // comment` becomes
`...string // comment,` instead of `...string, // comment`.

For #4238

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I6b1b887195fce3255d88090fc4eb930f446f2f69
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1229756
Reviewed-by: Matthew Sackman <matthew@cue.works>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>

+16
+16
cue/format/testdata/comments.txtar
··· 173 173 [string]: _ // comment 174 174 } 175 175 } 176 + 177 + // issue #4238 178 + [string]: [ 179 + ...string // inline comment without a comma 180 + ] 181 + [string]: [ 182 + ...string, // inline comment with a comma 183 + ] 176 184 -- out/format/comments.golden -- 177 185 // Package line 1 group 1 178 186 // Package line 2 group 1 ··· 332 340 333 341 // an ellipsis 334 342 } 343 + 344 + // issue #4238 345 + [string]: [ 346 + ...string // inline comment without a comma, 347 + ] 348 + [string]: [ 349 + ...string // inline comment with a comma, 350 + ] 335 351 -- comment_alone.input -- 336 352 // Just one comment on its own. 337 353 -- out/format/comment_alone.golden --