# Tests that @test(eq) correctly handles struct elements with embedded scalars.
# For-comprehension bodies like {let X = v*4; X} produce a vertex whose
# BaseValue is a scalar (not *StructMarker), so writeStruct must emit it as
# an embedded expression: {4} rather than {}.
#
# pass: already-filled @test(eq, [{4}]) must pass.
# seed: bare @test(eq) on a comprehension list is seeded with {4} elements.
-- in/test.cue --
// Pass: comprehension body with embedded scalar — already filled.
pass: [for v in [1] {
	let X = v*4
	X
}] @test(eq, [{4}])

// Seed: bare @test(eq); CUE_UPDATE=1 must emit {4}, not {}.
seed: [for v in [1, 2] {
	let X = v*4
	X
}] @test(eq)
-- out/status.txt --
update: output passes run
force:  identical to update
-- out/update/test.cue --
// Pass: comprehension body with embedded scalar — already filled.
pass: [for v in [1] {
	let X = v*4
	X
}] @test(eq, [{4}])

// Seed: bare @test(eq); CUE_UPDATE=1 must emit {4}, not {}.
seed: [for v in [1, 2] {
	let X = v*4
	X
}] @test(eq, [{4}, {8}])
