# generated from the original tests.
# Henceforth it may be nicer to group tests into separate files.
-- in.cue --
import "struct"

t1: struct.MinFields(0) & ""
t2: struct.MinFields(0) & {a: 1}
t3: struct.MinFields(2) & {a: 1}
t4: struct.MaxFields(0) & {a: 1}
t5: struct.MaxFields(2) & {a: 1}
-- out/structs-v3 --
Errors:
t1: conflicting values "" and struct.MinFields(0) (mismatched types string and struct):
    ./in.cue:3:5
    ./in.cue:3:27
t4: invalid value {a:1} (does not satisfy struct.MaxFields(0)): len(fields) > MaxFields(0) (1 > 0):
    ./in.cue:6:5
    ./in.cue:6:22

Result:
import "struct"

t1: _|_ // t1: conflicting values "" and struct.MinFields(0) (mismatched types string and struct)
t2: {
	a: 1
}
t3: struct.MinFields(2) & {
	a: 1
}
t4: _|_ // t4: invalid value {a:1} (does not satisfy struct.MaxFields(0)): len(fields) > MaxFields(0) (1 > 0)
t5: {
	a: 1
}
-- diff/-out/structs-v3<==>+out/structs --
diff old new
--- old
+++ new
@@ -1,5 +1,5 @@
 Errors:
-t1: conflicting values struct.MinFields(0) and "" (mismatched types struct and string):
+t1: conflicting values "" and struct.MinFields(0) (mismatched types string and struct):
     ./in.cue:3:5
     ./in.cue:3:27
 t4: invalid value {a:1} (does not satisfy struct.MaxFields(0)): len(fields) > MaxFields(0) (1 > 0):
@@ -9,7 +9,7 @@
 Result:
 import "struct"
 
-t1: _|_ // t1: conflicting values struct.MinFields(0) and "" (mismatched types struct and string)
+t1: _|_ // t1: conflicting values "" and struct.MinFields(0) (mismatched types string and struct)
 t2: {
 	a: 1
 }
-- diff/explanation --
Benign differences in error message due to different order of
evaluation.
-- out/structs --
Errors:
t1: conflicting values struct.MinFields(0) and "" (mismatched types struct and string):
    ./in.cue:3:5
    ./in.cue:3:27
t4: invalid value {a:1} (does not satisfy struct.MaxFields(0)): len(fields) > MaxFields(0) (1 > 0):
    ./in.cue:6:5
    ./in.cue:6:22

Result:
import "struct"

t1: _|_ // t1: conflicting values struct.MinFields(0) and "" (mismatched types struct and string)
t2: {
	a: 1
}
t3: struct.MinFields(2) & {
	a: 1
}
t4: _|_ // t4: invalid value {a:1} (does not satisfy struct.MaxFields(0)): len(fields) > MaxFields(0) (1 > 0)
t5: {
	a: 1
}
