1
0
zrcadlo https://github.com/luanti-org/luanti.git synchronizováno 2025-12-12 18:25:26 +01:00

JSON: Support consistent larger max. depth of 1024

Tento commit je obsažen v:
Lars Mueller
2024-10-14 15:46:25 +02:00
odevzdal Lars Müller
rodič 4c419c4020
revize e2ea359925
4 změnil soubory, kde provedl 30 přidání a 8 odebrání

Zobrazit soubor

@@ -174,6 +174,21 @@ local function test_parse_json()
end
unittests.register("test_parse_json", test_parse_json)
local function test_write_json()
-- deeply nested structures should be preserved
local leaf = 42
local data = leaf
for i = 1, 1000 do
data = {data}
end
local roundtripped = minetest.parse_json(minetest.write_json(data))
for i = 1, 1000 do
roundtripped = roundtripped[1]
end
assert(roundtripped == 42)
end
unittests.register("test_write_json", test_write_json)
local function test_game_info()
local info = minetest.get_game_info()
local game_conf = Settings(info.path .. "/game.conf")