diff --git a/tests/GameCult.Caching.Tests/CultMathJsonTests.cs b/tests/GameCult.Caching.Tests/CultMathJsonTests.cs index ef8ea3d6..54e01e24 100644 --- a/tests/GameCult.Caching.Tests/CultMathJsonTests.cs +++ b/tests/GameCult.Caching.Tests/CultMathJsonTests.cs @@ -131,6 +131,14 @@ namespace GameCult.Caching.Tests Parse("""{"cos":{"x":1,"y":9},"cosine":{"x":2}}""").cosine.Should().Be(new float4(2f, 0f, 0f, 0f)); } + [Test] + public void Reading_SkipsUnknownNamesWhenCaseInsensitive() + { + var options = new JsonSerializerOptions { PropertyNameCaseInsensitive = true }.AddCultMathConverters(); + JsonSerializer.Deserialize("""{"extra":[1,2],"COSINE":{"x":3},"coss":{"x":4}}""", options).cosine.x.Should().Be(3f); + JsonSerializer.Deserialize("""{"X":1,"q":2,"Y":3}""", options).Should().Be(new float2(1f, 3f)); + } + [Test] public void Writing_NeverEmitsLegacyNames() {