Test 追加。Empty_extensionUsed

This commit is contained in:
ousttrue
2021-12-16 18:45:16 +09:00
parent 2662186336
commit 500b59d2ae
2 changed files with 38 additions and 2 deletions

View File

@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using UniJSON;
using UnityEngine;

View File

@@ -88,5 +88,42 @@ namespace UniGLTF
Assert.AreEqual(new string[] { "KHR_materials_unlit" },
parsed["extensionUsed"].ArrayItems().Select(x => x.GetString()).ToArray());
}
[Test]
public void Empty_extensionUsed()
{
var dst = GltfJsonUtil.FindUsedExtensionsAndUpdateJson(@"{
""asset"": {
""generator"": ""COLLADA2GLTF"",
""version"": ""2.0""
},
""scene"": 0,
""scenes"": [
{
""nodes"": [
0
]
}
}
],
""extensionUsed"": [""dummy""],
""materials"": [
{
""pbrMetallicRoughness"": {
""baseColorFactor"": [
0.800000011920929,
0.0,
0.0,
1.0
],
""metallicFactor"": 0.0
},
""name"": ""Red""
}
]
}");
var parsed = dst.ParseAsJson();
Assert.False(parsed.ContainsKey("extensionUsed"));
}
}
}