mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-24 06:35:39 +00:00
Update rbx_dom_lua to rojo-rbx/rbx-dom@7b03132 (#775)
Fixes a problem where the MaterialColors Lua encoder would return nothing
This commit is contained in:
@@ -282,6 +282,7 @@ types = {
|
|||||||
math.round(math.clamp(color.B, 0, 1) * 255)
|
math.round(math.clamp(color.B, 0, 1) * 255)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
return pod
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ return function()
|
|||||||
if ty == "table" then
|
if ty == "table" then
|
||||||
local visited = {}
|
local visited = {}
|
||||||
|
|
||||||
for key, valueA in pairs(a) do
|
for key, valueA in a do
|
||||||
visited[key] = true
|
visited[key] = true
|
||||||
|
|
||||||
if not deepEq(valueA, b[key]) then
|
if not deepEq(valueA, b[key]) then
|
||||||
@@ -22,7 +22,7 @@ return function()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for key, valueB in pairs(b) do
|
for key, valueB in b do
|
||||||
if visited[key] then
|
if visited[key] then
|
||||||
continue
|
continue
|
||||||
end
|
end
|
||||||
@@ -44,28 +44,23 @@ return function()
|
|||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
for testName, testEntry in pairs(allValues) do
|
for testName, testEntry in allValues do
|
||||||
it("round trip " .. testName, function()
|
it("round trip " .. testName, function()
|
||||||
local ok, decoded = EncodedValue.decode(testEntry.value)
|
local decodeOk, decoded = EncodedValue.decode(testEntry.value)
|
||||||
assert(ok, decoded)
|
assert(decodeOk, decoded)
|
||||||
|
|
||||||
if extraAssertions[testName] ~= nil then
|
if extraAssertions[testName] ~= nil then
|
||||||
extraAssertions[testName](decoded)
|
extraAssertions[testName](decoded)
|
||||||
end
|
end
|
||||||
|
|
||||||
local ok, encoded = EncodedValue.encode(decoded, testEntry.ty)
|
local encodeOk, encoded = EncodedValue.encode(decoded, testEntry.ty)
|
||||||
assert(ok, encoded)
|
assert(encodeOk, encoded)
|
||||||
|
|
||||||
if not deepEq(encoded, testEntry.value) then
|
if not deepEq(encoded, testEntry.value) then
|
||||||
local expected = HttpService:JSONEncode(testEntry.value)
|
local expected = HttpService:JSONEncode(testEntry.value)
|
||||||
local actual = HttpService:JSONEncode(encoded)
|
local actual = HttpService:JSONEncode(encoded)
|
||||||
|
|
||||||
local message = string.format(
|
error(`Round-trip results did not match.\nExpected:\n{expected}\nActual:\n{actual}`)
|
||||||
"Round-trip results did not match.\nExpected:\n%s\nActual:\n%s",
|
|
||||||
expected, actual
|
|
||||||
)
|
|
||||||
|
|
||||||
error(message)
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user