From 0b6d0da2694025e4934758896df6aa61781b544e Mon Sep 17 00:00:00 2001 From: Roger Peppe Date: Fri, 18 Oct 2024 13:24:27 +0100 Subject: [PATCH] cmd/cue: add test case for issue 3250 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `@if` tags are currently treated as false when they're inside a non-package file inside a module. Add a test case for this, to be fixed in a subsequent CL. For #3250. Signed-off-by: Roger Peppe Change-Id: I1aafec01ce2586158488bb30d77506622e53eaee Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1202737 Unity-Result: CUE porcuepine TryBot-Result: CUEcueckoo Reviewed-by: Daniel Martí --- cmd/cue/cmd/testdata/script/issue3250.txtar | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 cmd/cue/cmd/testdata/script/issue3250.txtar diff --git a/cmd/cue/cmd/testdata/script/issue3250.txtar b/cmd/cue/cmd/testdata/script/issue3250.txtar new file mode 100644 index 00000000000..55546225e89 --- /dev/null +++ b/cmd/cue/cmd/testdata/script/issue3250.txtar @@ -0,0 +1,21 @@ +# This checks that @if tags work for files specified on the command line. + +# passes - no module +exec cue export -t foo .:foo +exec cue export -t foo foo.cue + +# set up module +exec cue mod init + +# passes - with module +exec cue export -t foo .:foo + +# fails - with module +# TODO fix this case +! exec cue export -t foo foo.cue + +-- foo.cue -- +@if(foo) +package foo + +x: 1