Add bidi text preservation coverage - #4656
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The asynchronous field-access path is not currently tested as intended.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds mixed-direction Arabic and Hebrew text preservation coverage across SqlClient data paths.
Changes:
- Tests logical UTF-16 round trips.
- Covers parameters, readers, streaming, bulk copy, and sync/async execution.
- Adds manual globalization tests without asserting rendering behavior.
File summaries
| File | Review |
|---|---|
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/GlobalizationTest/DirectionalityTest.cs |
Adds bidirectional text tests. The async case must exercise GetFieldValueAsync<string>; XML documentation also needs missing parameter and return tags. |
Review details
Suppressed comments (7)
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/GlobalizationTest/DirectionalityTest.cs:60
- This helper’s XML documentation omits both parameter descriptions and the returned task. Add the missing tags so the test helper contract is complete.
private static async Task OpenConnection(SqlConnection connection, bool async)
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/GlobalizationTest/DirectionalityTest.cs:75
- This helper’s XML documentation omits its parameter descriptions and returned task. Add the missing tags so callers can understand the execution-mode and table-name arguments.
private static async Task InsertValues(SqlConnection connection, string tableName, bool async)
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/GlobalizationTest/DirectionalityTest.cs:100
- This helper’s XML documentation omits its parameter descriptions and returned task. Add the missing tags to document the table being verified and the selected reader path.
private static async Task VerifyOrdinaryReader(SqlConnection connection, string tableName, bool async)
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/GlobalizationTest/DirectionalityTest.cs:122
- This helper’s XML documentation omits its parameter descriptions and returned task. Add the missing tags to document the sequential-reader inputs and execution mode.
private static async Task VerifyGetChars(SqlConnection connection, string tableName, bool async)
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/GlobalizationTest/DirectionalityTest.cs:153
- This helper’s XML documentation omits its parameter descriptions and returned task. Add the missing tags to document the sequential-reader inputs and sync/async text-read mode.
private static async Task VerifyTextReader(SqlConnection connection, string tableName, bool async)
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/GlobalizationTest/DirectionalityTest.cs:185
- This helper’s XML documentation omits its parameter descriptions and returned task. Add the missing tags to document both table arguments and the bulk-copy execution mode.
private static async Task CopyValues(string sourceTableName, string destinationTableName, bool async)
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/GlobalizationTest/DirectionalityTest.cs:217
- This helper’s XML documentation omits descriptions for both string arguments. Add the missing parameter tags so the assertion helper’s contract is fully documented.
private static void AssertOrdinalEqual(string expected, string actual)
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| Assert.True(hasRow); | ||
| Assert.Equal(index, reader.GetInt32(0)); | ||
| AssertOrdinalEqual(s_bidiText[index], reader.GetString(1)); | ||
| AssertOrdinalEqual(s_bidiText[index], reader.GetFieldValue<string>(1)); |
Summary
GetChars,GetTextReader, and streaming bulk copyADO task: #45864
Validation
DirectionalityTestonnet462: 2 passedDirectionalityTestonnet8.0: 2 passedDirectionalityTestonnet9.0: 2 passedTests added or updated
Public API changes documented — N/A, no public API changes
Verified against customer repro — N/A, compliance validation
Ensure no breaking changes introduced