mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-25 02:20:58 -05:00
test(parser): Add reproduction of #481
This commit is contained in:
parent
4869764f7b
commit
7e15afe81f
1 changed files with 19 additions and 0 deletions
|
@ -1148,6 +1148,25 @@ mod test {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn tokenize_hash_in_mixed_path() {
|
||||
let parser = TokenizerBuilder::new().build();
|
||||
|
||||
let input = " /// at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7\\/src\\libstd\\rt.rs:51";
|
||||
let expected: Vec<Identifier> = vec![
|
||||
Identifier::new_unchecked("at", Case::None, 25),
|
||||
Identifier::new_unchecked("rustc", Case::None, 29),
|
||||
Identifier::new_unchecked("c7087fe00d2ba919df1d813c040a5d47e43b0fe7", Case::None, 35), // BUG: This shouldn't be here
|
||||
Identifier::new_unchecked("src", Case::None, 77),
|
||||
Identifier::new_unchecked("rs", Case::None, 91),
|
||||
Identifier::new_unchecked("51", Case::None, 94),
|
||||
];
|
||||
let actual: Vec<_> = parser.parse_bytes(input.as_bytes()).collect();
|
||||
assert_eq!(expected, actual);
|
||||
let actual: Vec<_> = parser.parse_str(input).collect();
|
||||
assert_eq!(expected, actual);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn tokenize_ignore_base64_case_1() {
|
||||
let parser = TokenizerBuilder::new().build();
|
||||
|
|
Loading…
Reference in a new issue