-
-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Don't rely on
removeDiacritics
to highlight text (#4636)
* When we highlight a suggestion, we can't rely on the `removeDiacritics`, as it replaces some letters of 1 word into 2 or + * Better algorithm * Remove unused things * Fix typo * Unnecessary brackets * Replace all `toLowerCase` + `removeDiacritics` by a single `getComparisonSafeString` * Reformat CountrySelector * `removeAccents` removed + 1 new test --------- Co-authored-by: monsieurtanuki <[email protected]>
- Loading branch information
1 parent
f81ba98
commit e904b05
Showing
6 changed files
with
128 additions
and
39 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:smooth_app/widgets/smooth_text.dart' show StringExtension; | ||
|
||
void main() { | ||
group('Smooth text', () { | ||
group('String extension', () { | ||
test('Remove diacritics (oeuf)', () { | ||
expect( | ||
'œuf'.removeDiacritics(), | ||
equals('oeuf'), | ||
); | ||
}); | ||
test('Comparison Safe String', () { | ||
expect( | ||
'œuF'.getComparisonSafeString(), | ||
equals('oeuf'), | ||
); | ||
}); | ||
}); | ||
}); | ||
} |