test(tokens): Show parsing of a public key

This commit is contained in:
Ed Page committed 2026-04-27 10:39:07 -05:00
1 parent 93c857b593
commit 4da614bf1e
1 file changed
+56
+56
View File
@@ -1614,6 +1614,62 @@ mod test {
},
]
"#]]
);
}
#[test]
fn tokenize_ignore_ssh_ed25519_public_key() {
let parser = TokenizerBuilder::new().build();
let input =
"Start AAAAC3NzaC1lZDI1NTE5AAAAIJSKdqkBEQY2y9f8C8RXxee3ZKXyWYR0QIW7oxISXrrf end";
let actual: Vec<_> = parser.parse_bytes(input.as_bytes()).collect();
assert_data_eq!(
actual.to_debug(),
str![[r#"
[
Identifier {
token: "Start",
case: None,
offset: 0,
},
Identifier {
token: "AAAAC3NzaC1lZDI1NTE5AAAAIJSKdqkBEQY2y9f8C8RXxee3ZKXyWYR0QIW7oxISXrrf",
case: None,
offset: 6,
},
Identifier {
token: "end",
case: None,
offset: 75,
},
]
"#]]
);
let actual: Vec<_> = parser.parse_str(input).collect();
assert_data_eq!(
actual.to_debug(),
str![[r#"
[
Identifier {
token: "Start",
case: None,
offset: 0,
},
Identifier {
token: "AAAAC3NzaC1lZDI1NTE5AAAAIJSKdqkBEQY2y9f8C8RXxee3ZKXyWYR0QIW7oxISXrrf",
case: None,
offset: 6,
},
Identifier {
token: "end",
case: None,
offset: 75,
},
]
"#]]
);
}