Minor fixes and API change

- fix stupid spaces in Makefile
- small type annotation fix
- Modify Expression constructor API to use varargs
- Update kiwi.lua to support future C API module
This commit is contained in:
2024-02-19 23:42:52 -06:00
parent 9b00e62d43
commit 6a99504835
3 changed files with 32 additions and 23 deletions

View File

@@ -42,7 +42,7 @@ describe("Constraint", function()
c = kiwi.Constraint(lhs / 2, nil, "LE", kiwi.strength.MEDIUM)
assert.equal("0.5 foo + 0.5 <= 0 | medium", tostring(c))
c = kiwi.Constraint(lhs, kiwi.Expression(nil, 3), "GE", kiwi.strength.WEAK)
c = kiwi.Constraint(lhs, kiwi.Expression(3), "GE", kiwi.strength.WEAK)
assert.equal("1 foo + -2 >= 0 | weak", tostring(c))
end)
@@ -68,7 +68,7 @@ describe("Constraint", function()
end)
it("combines lhs and rhs", function()
local v2 = kiwi.Var("bar")
local rhs = kiwi.Expression({ 5 * v2, 3 * v }, 3)
local rhs = kiwi.Expression(3, 5 * v2, 3 * v)
local c = kiwi.Constraint(lhs, rhs)
local e = c:expression()