Skip to content

Commit

Permalink
cmd/cue: add test case for issue 3250
Browse files Browse the repository at this point in the history
`@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 <[email protected]>
Change-Id: I1aafec01ce2586158488bb30d77506622e53eaee
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1202737
Unity-Result: CUE porcuepine <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
Reviewed-by: Daniel Martí <[email protected]>
  • Loading branch information
rogpeppe committed Oct 18, 2024
1 parent be8ed35 commit 0b6d0da
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions cmd/cue/cmd/testdata/script/issue3250.txtar
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0b6d0da

Please sign in to comment.