-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prefer case sensitive match over case insensitive (#1063)
Related to #860, improves upon #1056. <!-- ELLIPSIS_HIDDEN --> ---- > [!IMPORTANT] > Enhance `match_string` to prefer case-sensitive matches, update `coerce_bool` for case variations, and adjust tests accordingly. > > - **Behavior**: > - `match_string` in `match_string.rs` now prioritizes case-sensitive matches over case-insensitive ones. > - Handles punctuation by stripping it and retrying the match. > - `coerce_bool` in `coerce_primitive.rs` updated to handle different case variations of boolean strings. > - **Tests**: > - Added `case_sensitive_non_ambiguous_match` test in `test_enum.rs` for case-sensitive matching. > - Added `case_insensitive_ambiguous_match` failing test in `test_enum.rs` to ensure ambiguous matches are not incorrectly resolved. > - Updated existing tests in `test_enum.rs` to align with new matching logic. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup> for 8fdc5b4. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
- Loading branch information
1 parent
830b0cb
commit cd6b141
Showing
3 changed files
with
61 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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