Skip to content

[Testing] Re-enable CachedFilenameIsCorrectAndValid test #30648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 22, 2025
Merged

Conversation

jsuarezruiz
Copy link
Contributor

Description of Change

The runtime issue has been resolved in .NET 10.0 and test CachedFilenameIsCorrectAndValid has been already enabled. Based on the original issue dotnet/runtime#111506, this PR include some tests in the UriImageSourceServiceTests.cs file to specifically verify that the String.Replace() method with StringComparison.OrdinalIgnoreCase works correctly across all platforms.

Issues Fixed

Fixes #27317

@Copilot Copilot AI review requested due to automatic review settings July 16, 2025 09:38
@jsuarezruiz jsuarezruiz added the area-testing Unit tests, device tests label Jul 16, 2025
@jsuarezruiz jsuarezruiz requested a review from a team as a code owner July 16, 2025 09:38
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR re-enables a previously disabled test and adds comprehensive regression tests to verify that String.Replace() with StringComparison.OrdinalIgnoreCase works correctly across all platforms in .NET 10.0. The original issue was a runtime bug that caused "IndexOf with matchLength" errors when using case-insensitive string replacement operations.

  • Adds four new test methods to verify different scenarios of case-insensitive string replacement
  • Includes tests for basic replacement, multiple occurrences, special characters, and long strings
  • Provides regression coverage for the resolved .NET runtime issue #111506
Comments suppressed due to low confidence (3)

src/Core/tests/DeviceTests/Services/ImageSource/UriImageSourceServiceTests.cs:26

  • The test method name 'StringReplaceWithMultipleOccurrences' is too generic for the MAUI codebase context. Consider renaming to 'CachedFilenameTemplateWithMultipleHashPlaceholders' or similar to reflect its relationship to image caching functionality.
		// Tests String.Replace with multiple occurrences of the search string

src/Core/tests/DeviceTests/Services/ImageSource/UriImageSourceServiceTests.cs:36

  • The test method name 'StringReplaceWithSpecialCharacters' is too generic. Consider renaming to 'CachedFilenameHandlesSpecialCharactersInHash' to better reflect its purpose in the image source service context.
		// Tests String.Replace with special characters in template and replacement

src/Core/tests/DeviceTests/Services/ImageSource/UriImageSourceServiceTests.cs:46

  • The test method name 'StringReplaceWithLongStrings' is too generic. Consider renaming to 'CachedFilenameHandlesLongHashValues' to better align with the image source service domain.
		// Tests String.Replace with a long template and replacement

Copy link
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

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

Failing test not related

@rmarinho rmarinho merged commit abc10eb into net10.0 Jul 22, 2025
127 of 129 checks passed
@rmarinho rmarinho deleted the fix-27317 branch July 22, 2025 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-testing Unit tests, device tests testing-reenable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants