8000 Fixes handling of `Turkish I` by ctolkien · Pull Request #153 · ctolkien/Slugify · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fixes handling of Turkish I #153

10000
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 4 commits into from
Mar 18, 2025
Merged

Fixes handling of Turkish I #153

merged 4 commits into from
Mar 18, 2025

Conversation

ctolkien
Copy link
Owner

This PR builds on the changes in #151

Fixes #10

@ctolkien ctolkien requested a review from Copilot March 18, 2025 11:23
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

Fixes handling of Turkish I and introduces maximum length support in slug generation.

  • Updates the TurkishEncodingOfI test expected output and removes the Skip attribute.
  • Adds a new theory test for MaximumLength behavior.
  • Switches to ToLowerInvariant for consistent lower casing and introduces MaximumLength configuration in production code.
  • Updates README.md documentation to include the new MaximumLength option.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

File Description
tests/Slugify.Core.Tests/SlugHelperTests.cs Updated Turkish I test expected output and added MaximumLength tests
src/Slugify.Core/SlugHelper.cs Changed to using ToLowerInvariant and implemented MaximumLength trimming logic
src/Slugify.Core/SlugHelperConfiguration.cs Added MaximumLength property to configuration
README.md Documented the new MaximumLength option
Comments suppressed due to low confidence (1)

tests/Slugify.Core.Tests/SlugHelperTests.cs:713

  • The expected output in the TurkishEncodingOfI test was changed from 'fıfa 18' to 'fifa-18'. Validate that this updated expected value properly reflects the intended Turkish lowercase behavior.
const string expected = "fifa-18";

@ctolkien ctolkien requested a review from Copilot March 18, 2025 11:30
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 addresses the handling of the Turkish letter "I" by updating case conversion to use an invariant method, ensuring consistent slug generation.

  • Updates case conversion in SlugHelper to use ToLowerInvariant
  • Adjusts the Turkish encoding test by removing the skip and updating the expected output

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/Slugify.Core/SlugHelper.cs Changed case conversion to use ToLowerInvariant for culture-independent behavior
tests/Slugify.Core.Tests/SlugHelperTests.cs Enabled and updated the Turkish encoding test to reflect invariant slug output changes
Comments suppressed due to low confidence (1)

tests/Slugify.Core.Tests/SlugHelperTests.cs:711

  • The test sets CultureInfo.CurrentCulture without restoring the original value, which may affect other tests. Consider saving the original culture and restoring it in a finally block.
CultureInfo.CurrentCulture = new CultureInfo("tr-TR");

@ctolkien ctolkien merged commit 708bcbf into main Mar 18, 2025
4 checks passed
@ctolkien ctolkien deleted the turkish-i branch March 18, 2025 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ignores capital 'I'
1 participant
0