Skip to content

Commit 77fa2cf

Browse files
committed
Fix JSON test comparison to handle Unicode escape differences
System.Text.Json serializes supplementary-plane characters (e.g. U+29E3D) as \uD867\uDE3D escape sequences, while SQL Server returns them as literal UTF-8. The DeepEqualsCore fallback compared GetRawText() which preserves escaping differences. Add explicit JsonValueKind.String case using GetString() which decodes both representations to the same .NET string.
1 parent 748d5ca commit 77fa2cf

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/JsonTest/JsonTestHelper.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ private static bool DeepEqualsCore(JsonElement a, JsonElement b, int depth)
7373
}
7474
return !arrB.MoveNext();
7575

76+
case JsonValueKind.String:
77+
return a.GetString() == b.GetString();
78+
7679
default:
7780
return a.GetRawText() == b.GetRawText();
7881
}

0 commit comments

Comments
 (0)