CultMathJson tests: unknown names are skipped under case-insensitive reading
Kills the surviving Stryker mutant in Fields.IndexOf's case-insensitive loop and covers its not-found return. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
1330362235
commit
841b11db94
1 changed files with 8 additions and 0 deletions
|
|
@ -131,6 +131,14 @@ namespace GameCult.Caching.Tests
|
|||
Parse<CultPhasor>("""{"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<CultPhasor>("""{"extra":[1,2],"COSINE":{"x":3},"coss":{"x":4}}""", options).cosine.x.Should().Be(3f);
|
||||
JsonSerializer.Deserialize<float2>("""{"X":1,"q":2,"Y":3}""", options).Should().Be(new float2(1f, 3f));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Writing_NeverEmitsLegacyNames()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue