Skip to content

Commit

Permalink
cmd/cue: add test case for embedding of CUE file type files
Browse files Browse the repository at this point in the history
For the initial implementation of embed we do not want to support
embedding of the CUE file type.

However the implementation currently allows it.

Ahead of fixing issue #3258 in a later CL to remove support for the CUE
file type, we add a test in embed_err.txtar. The test reflects the
current behaviour whereby a .cue file (or a file with an explicit CUE
file type) is not an error. This bug is fixed (and the test expectation
updated) in a later CL.

For #3258.

Signed-off-by: Paul Jolly <[email protected]>
Change-Id: I43ed4a3ce5c35c33a9256fa0af3304feb79f233c
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1197336
TryBot-Result: CUEcueckoo <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
Reviewed-by: Roger Peppe <[email protected]>
  • Loading branch information
myitcv committed Jul 8, 2024
1 parent 5c8be53 commit 868c110
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/cue/cmd/testdata/script/embed_err.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ norm4: _ @embed(file="x//test.json")

noTranslateBS: _ @embed(file="x\\test.json")

autoCUEfiletype: _ @embed(file="x.cue")
explicitCUEfiletype: _ @embed(file=xcue, type=cue)

-- test.json --
{ "x": 34 }
-- test.ldjson --
Expand All @@ -67,6 +70,10 @@ a1: 2
a1: 2
-- test.textproto --
a: 1
-- x.cue --
x: 5
-- xcue --
x: 5
-- out/std --
-- out/err --
@embed: attribute must have file or glob field:
Expand Down

0 comments on commit 868c110

Please sign in to comment.