mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-25 10:31:02 -05:00
test: Ensure words are stored lowercase
This commit is contained in:
parent
0008713395
commit
4e99217896
1 changed files with 8 additions and 2 deletions
|
@ -17,10 +17,16 @@ fn generate<W: std::io::Write>(file: &mut W, dict: &[u8]) {
|
|||
.map(Result::unwrap)
|
||||
.for_each(|r| {
|
||||
let mut i = r.iter();
|
||||
let typo = UniCase::new(i.next().expect("typo").to_owned());
|
||||
let mut typo = i.next().expect("typo").to_owned();
|
||||
typo.make_ascii_lowercase();
|
||||
let typo = UniCase::new(typo);
|
||||
rows.entry(typo)
|
||||
.or_insert_with(|| Vec::new())
|
||||
.extend(i.map(ToOwned::to_owned));
|
||||
.extend(i.map(|c| {
|
||||
let mut c = c.to_owned();
|
||||
c.make_ascii_lowercase();
|
||||
c
|
||||
}));
|
||||
});
|
||||
|
||||
let disallowed_typos = varcon_words();
|
||||
|
|
Loading…
Reference in a new issue