mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-24 18:10:56 -05:00
test(varcon): Show basic abbr parsing
This commit is contained in:
parent
3b2dd279b7
commit
e85562501a
1 changed files with 46 additions and 0 deletions
|
@ -1346,6 +1346,52 @@ Entry {
|
|||
comment: None,
|
||||
}
|
||||
|
||||
"#]]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_abbr() {
|
||||
// Having nothing after `A` causes an incomplete parse. Shouldn't be a problem for my use
|
||||
// cases.
|
||||
let (input, actual) = Entry::parse_.parse_peek("A B: ha | <abbr>\n").unwrap();
|
||||
assert_data_eq!(
|
||||
input,
|
||||
str![[r#"
|
||||
|
||||
|
||||
"#]]
|
||||
);
|
||||
assert_data_eq!(
|
||||
actual.to_debug(),
|
||||
str![[r#"
|
||||
Entry {
|
||||
variants: [
|
||||
Variant {
|
||||
types: [
|
||||
Type {
|
||||
category: American,
|
||||
tag: None,
|
||||
num: None,
|
||||
},
|
||||
Type {
|
||||
category: BritishIse,
|
||||
tag: None,
|
||||
num: None,
|
||||
},
|
||||
],
|
||||
word: "ha",
|
||||
},
|
||||
],
|
||||
pos: None,
|
||||
archaic: false,
|
||||
note: false,
|
||||
description: Some(
|
||||
"<abbr>",
|
||||
),
|
||||
comment: None,
|
||||
}
|
||||
|
||||
"#]]
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue