def test_domain_constant_generator(): c = Qit() s = Int() * Int() f = s.value((7, 8)).make_function() d = Domain(Int(), generator=f()) result = c.run(d.generate().take(5)) assert result == [ (7, 8) ] * 5
def test_struct_constructor(): ctx = Qit() x = Variable(Int(), "x") s = Int() * Int() * Int() result = ctx.run(s.value((x, 10, x)), args={x: 11}) assert result == (11, 10, 11)