From 868c110835a15f67a83e2c14e7e0be2b429fb3cf Mon Sep 17 00:00:00 2001 From: Paul Jolly Date: Fri, 5 Jul 2024 16:19:21 +0100 Subject: [PATCH] cmd/cue: add test case for embedding of CUE file type files 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 Change-Id: I43ed4a3ce5c35c33a9256fa0af3304feb79f233c Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1197336 TryBot-Result: CUEcueckoo Unity-Result: CUE porcuepine Reviewed-by: Roger Peppe --- cmd/cue/cmd/testdata/script/embed_err.txtar | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/cue/cmd/testdata/script/embed_err.txtar b/cmd/cue/cmd/testdata/script/embed_err.txtar index 63fef3a5b33..5fbb9169129 100644 --- a/cmd/cue/cmd/testdata/script/embed_err.txtar +++ b/cmd/cue/cmd/testdata/script/embed_err.txtar @@ -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 -- @@ -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: