-- in.cue --
// Structural permute tests: @test(permute) placed on the struct whose fields
// should be permuted — either as a decl attr on the container, or as a decl
// attr directly on the 'in' struct.

// ── Container-level @test(permute): permutes all fields of `in` ──

threeFieldPermute: {
	a: b + c
	b: 1
	c: 2
}

twoFieldPermute: {
	x: y + 1
	y: 5
}

// ── Decl attr on `in` directly: equivalent syntax ──

inDeclPermute: {
	p: q + r
	q: 3
	r: 7
}

// ── Self-contained concrete struct: trivially order-invariant ──

concretePermute: {
	x: {
		alpha: 1
		beta:  2
		gamma: 3
	}
	y: {
		alpha: 1
		beta:  2
		gamma: 3
	}
}
-- out/compile --
--- in.cue
{
  threeFieldPermute: {
    a: (〈0;b〉 + 〈0;c〉)
    b: 1
    c: 2
  }
  twoFieldPermute: {
    x: (〈0;y〉 + 1)
    y: 5
  }
  inDeclPermute: {
    p: (〈0;q〉 + 〈0;r〉)
    q: 3
    r: 7
  }
  concretePermute: {
    x: {
      alpha: 1
      beta: 2
      gamma: 3
    }
    y: {
      alpha: 1
      beta: 2
      gamma: 3
    }
  }
}
