Skip to content

Commit

Permalink
cmd/cue: ensure that fmt works outside a module with files too
Browse files Browse the repository at this point in the history
https://cuelang.org/cl/1194851 fixed this recent regression
and added a test case with stdin outside of a CUE module,
but it didn't add a similar test case with a file argument.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I06a17b1edf8651210a0123b0f260f42d16031a93
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194853
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Paul Jolly <paul@myitcv.io>
  • Loading branch information
mvdan committed May 17, 2024
1 parent 078020b commit 11cbcd3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/cue/cmd/testdata/script/fmt_import_no_module.txtar
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# This tests that when there's an import and no current module,
# fmt will still work.
# fmt will still work with both stdin and files.

stdin a/x.cue
exec cue fmt -
cmp stdout a.cue-want

exec cue fmt a/x.cue
cmp a/x.cue a.cue-want

-- a/x.cue --
package x

Expand Down

0 comments on commit 11cbcd3

Please sign in to comment.