Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Empty strings, digits/punctuation, and uncased scripts currently pass both
is lowerandis upper. Case conversion equality also misclassifies Unicode characters such asªthat have a case property without an uppercase mapping.Require at least one character with the relevant Unicode case property and reject characters with the opposite or title case property. Cover uncased strings, mixed case, accented letters, titlecase characters, and
ª. This follows the string case predicates used by Jinja.Validation: 776 tests pass across the templates, utilities, interpreter, formatting, and memory suites; Jinja build (including TypeScript declarations), ESLint, formatting, and
git diff --checkpass. Four regression cases fail before the change.The model-download e2e suite is excluded: this checkout lacks a built
@huggingface/hubworkspace dependency.Note
Low Risk
Localized change to built-in Jinja string tests with new regression tests; no auth, security, or API surface impact.
Overview
Fixes
is lowerandis upperso they match upstream Jinja instead of treatingstr === str.toLowerCase()/toUpperCase()as sufficient.Each test now requires at least one Unicode character with the relevant case property and rejects opposite-case or titlecase (
\p{Lt}) letters. Strings with no cased letters (empty, digits, punctuation, uncased scripts), mixed case, and edge cases likeªandDžno longer incorrectly satisfy both tests.Regression coverage was added under Feature regressions with parameterized
is lower/is upperexpectations.Reviewed by Cursor Bugbot for commit 7921a76. Bugbot is set up for automated code reviews on this repo. Configure here.