stopping for the night

This commit is contained in:
Michael Freno
2025-10-14 01:58:03 -04:00
parent 3cc416dcff
commit 23ccabcbbd
4 changed files with 171 additions and 101 deletions

View File

@@ -188,8 +188,8 @@ function TestLayoutValidation:testNegativeDimensionsAndPositions()
luaunit.assertTrue(success) -- Should not crash
luaunit.assertEquals(element.x, -10) -- Negative positions should work
luaunit.assertEquals(element.y, -20)
luaunit.assertEquals(element.width, -50) -- Negative dimensions should work (though unusual)
luaunit.assertEquals(element.height, -30)
luaunit.assertEquals(element.width, 0) -- Negative dimensions are clamped to 0
luaunit.assertEquals(element.height, 0) -- Negative dimensions are clamped to 0
end
-- Test 6: Extremely Large Values
@@ -929,6 +929,18 @@ function TestLayoutValidation:testCircularReferenceValidation()
container1:layoutChildren()
end)
-- Clean up the circular reference to restore valid structure
-- Remove container2 from container5's children
if container5.children and #container5.children > 0 then
for i = #container5.children, 1, -1 do
if container5.children[i] == container2 then
table.remove(container5.children, i)
end
end
end
-- Restore container2's original parent
container2.parent = container1
return {
container1 = container1,
container2 = container2,
@@ -948,7 +960,7 @@ function TestLayoutValidation:testCircularReferenceValidation()
luaunit.assertIsTable(result.container2)
luaunit.assertIsTable(result.container3)
-- Test that final layout still works
-- Test that final layout still works after cleanup
local finalLayoutSuccess = captureError(function()
result.container1:layoutChildren()
end)