Skip to content

Commit

Permalink
cue/format: add test for incorrect formatting
Browse files Browse the repository at this point in the history
A recent CL https://cuelang.org/cl/1170966 fixed up list element
indentation, but accidentally introduced a regression causing alignment
issues between fields in certain cases.

This CL adds a test indicating various cases in which the alignment is
now incorrect.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: I328f137d7e095a18cd0d91f57739f30b8f71d990
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1193255
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
  • Loading branch information
NoamTD authored and mvdan committed Apr 22, 2024
1 parent 2d72477 commit 9839112
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cue/format/testdata/expressions.golden
Original file line number Diff line number Diff line change
Expand Up @@ -269,4 +269,13 @@ import "list"
o: [{}]
o: [{}]
o: [{}]

p: 1
p: p & {p: 2}
q: 1
q: q | {q: 2}
r: 1
r: b & [1, 2, {a: 4}]
s: [string]: [string]: a
s: [string]: {s: string}
}
9 changes: 9 additions & 0 deletions cue/format/testdata/expressions.input
Original file line number Diff line number Diff line change
Expand Up @@ -266,4 +266,13 @@ import "list"
o: [ {}]
o: [{} ]
o: [ {} ]

p: 1
p: p & {p: 2}
q: 1
q: q | {q: 2}
r: 1
r: b & [1, 2, {a: 4}]
s: [string]: [string]: a
s: [string]: {s: string}
}

0 comments on commit 9839112

Please sign in to comment.