Skip to content

Add bidi text preservation coverage - #4656

Open
priyankatiwari08 wants to merge 1 commit into
dotnet:mainfrom
priyankatiwari08:priyankatiwari08-directionality-45864
Open

Add bidi text preservation coverage#4656
priyankatiwari08 wants to merge 1 commit into
dotnet:mainfrom
priyankatiwari08:priyankatiwari08-directionality-45864

Conversation

@priyankatiwari08

Copy link
Copy Markdown
Contributor

Summary

  • add focused Arabic and Hebrew mixed-direction text round-trip coverage
  • verify logical UTF-16 preservation through parameters, ordinary and sequential readers, GetChars, GetTextReader, and streaming bulk copy
  • cover synchronous and asynchronous paths without asserting UI rendering behavior

ADO task: #45864

Validation

  • DirectionalityTest on net462: 2 passed

  • DirectionalityTest on net8.0: 2 passed

  • DirectionalityTest on net9.0: 2 passed

  • Tests 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

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 7, 2026 14:12
@priyankatiwari08
priyankatiwari08 requested a review from a team as a code owner September 7, 2026 14:12
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Sep 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To triage

Development

Successfully merging this pull request may close these issues.

2 participants