mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-10-31 15:35:21 +01:00 
			
		
		
		
	Various improvements to push_json_value
This commit is contained in:
		| @@ -153,6 +153,18 @@ local function test_urlencode() | ||||
| end | ||||
| unittests.register("test_urlencode", test_urlencode) | ||||
|  | ||||
| local function test_parse_json() | ||||
| 	local raw = "{\"how\\u0000weird\":\n\"yes\\u0000really\",\"n\":-1234567891011,\"z\":null}" | ||||
| 	local data = core.parse_json(raw) | ||||
| 	assert(data["how\000weird"] == "yes\000really") | ||||
| 	assert(data.n == -1234567891011) | ||||
| 	assert(data.z == nil) | ||||
| 	local null = {} | ||||
| 	data = core.parse_json(raw, null) | ||||
| 	assert(data.z == null) | ||||
| end | ||||
| unittests.register("test_parse_json", test_parse_json) | ||||
|  | ||||
| local function test_game_info() | ||||
| 	local info = minetest.get_game_info() | ||||
| 	local game_conf = Settings(info.path .. "/game.conf") | ||||
|   | ||||
		Reference in New Issue
	
	Block a user