chickensoft-games / LogicBlocks

Human-friendly, hierarchical state machines for games and apps in C#.
https://www.nuget.org/packages/Chickensoft.LogicBlocks
MIT License
152 stars 6 forks source link

test: fix serialization tests on Windows #39

Closed wlsnmrk closed 3 weeks ago

wlsnmrk commented 3 weeks ago

Serialization tests (Chickensoft.LogicBlocks.Tests.Serialization.LogicBlockSerialization.SerializesLogicBlock and Chickensoft.LogicBlocks.Tutorial.Tests.SerializableLogicBlockTests.Serializes) fail on Windows:

Screenshot 2024-06-20 133319

This is because the generated JSON has CRLF line endings on Windows, but the expected string literal has LF:

Screenshot 2024-06-20 132351

This change uses JsonNode.DeepEquals() to compare expected and generated JSON strings, avoiding whitespace issues generally, as recommended in the proposal discussion for the forthcoming JsonSerializerOptions.NewLine property.