Commit 17317ca
committed
cue/format: add test case for formatting empty and near-empty files
They all behave as expected, but as I investigated the report at
https://cuelang.org/issue/3895 I noticed we lacked some test cases.
Note that the empty.input file has zero bytes, and empty.golden has one,
which is just a newline. Formatting empty CUE source files as one
newline seems reasonable given that we always end CUE source with
one newline. Modern text editors seem to do the same with empty files.
Signed-off-by: Daniel Martí <[email protected]>
Change-Id: I58caeb2f2709a84adfd0f2aa223a8068e5de72bb
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1214303
TryBot-Result: CUEcueckoo <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
Reviewed-by: Paul Jolly <[email protected]>1 parent 4b194d7 commit 17317ca
2 files changed
+15
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
3 | 6 | | |
4 | 7 | | |
5 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
3 | 15 | | |
4 | 16 | | |
5 | 17 | | |
| |||
0 commit comments