File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
cmd/cue/cmd/testdata/script Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Issue 4009
2
+ # cue/load parses input CUE files more than once; for example,
3
+ # first to only parse the imports, and later to parse the whole file.
4
+ # Reading an input file multiple times only works if it's a regular file.
5
+ # Make sure that the various ways to consume stdin do not attempt
6
+ # to open or read the file more than once.
7
+
8
+ # Sanity check: use the regular file.
9
+ exec cue export cue: other
10
+ cmp stdout export.stdout
11
+
12
+ # Use Go's os.Stdin directly.
13
+ stdin other
14
+ exec cue export cue: -
15
+ cmp stdout export.stdout
16
+
17
+ # Use /dev/stdin, a device file pointing to stdin.
18
+ [!unix] stop # /dev/stdin is not present on Windows
19
+ stdin other
20
+ exec cue export cue: /dev/stdin
21
+ cmp stdout export-broken.stdout
22
+
23
+ -- cue.mod/module.cue --
24
+ module: "foo.test"
25
+ language: version: "v0.13.0"
26
+ -- other --
27
+ foo: "bar"
28
+ -- export.stdout --
29
+ {
30
+ "foo": "bar"
31
+ }
32
+ -- export-broken.stdout --
33
+ {}
You can’t perform that action at this time.
0 commit comments