mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-12-06 02:40:23 -08:00
Validate server JSON with org.json as well
This commit is contained in:
parent
45c21d60bf
commit
cecd84817c
2 changed files with 5 additions and 0 deletions
|
|
@ -26,6 +26,7 @@ import mindustry.type.*;
|
|||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.payloads.*;
|
||||
import mindustry.world.blocks.storage.*;
|
||||
import org.json.*;
|
||||
import org.junit.jupiter.api.*;
|
||||
import org.junit.jupiter.params.*;
|
||||
import org.junit.jupiter.params.provider.*;
|
||||
|
|
@ -227,11 +228,14 @@ public class ApplicationTests{
|
|||
void serverListJson(){
|
||||
String[] files = {"servers_v6.json", "servers_v7.json", "servers_be.json"};
|
||||
|
||||
|
||||
for(String file : files){
|
||||
try{
|
||||
String str = Core.files.absolute("./../../" + file).readString();
|
||||
assertEquals(ValueType.array, new JsonReader().parse(str).type());
|
||||
assertTrue(Jval.read(str).isArray());
|
||||
JSONArray array = new JSONArray(str);
|
||||
assertTrue(array.length() > 0);
|
||||
}catch(Exception e){
|
||||
fail("Failed to parse " + file, e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue