Skip to content

Commit 39e35a3

Browse files
committed
Bring back test-case to show how trailing slashes are handled (#1438)
1 parent b2bccbc commit 39e35a3

File tree

1 file changed

+13
-3
lines changed
  • gix-actor/tests/identity

1 file changed

+13
-3
lines changed

gix-actor/tests/identity/mod.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,22 @@ fn round_trip() -> gix_testtools::Result {
2222

2323
#[test]
2424
fn lenient_parsing() -> gix_testtools::Result {
25-
for input in [
26-
"First Last<<fl <First Last<[email protected] >> >",
27-
"First Last<fl <First Last<[email protected]>>\n",
25+
for (input, expected_email) in [
26+
(
27+
"First Last<<fl <First Last<[email protected] >> >",
28+
"fl <First Last<[email protected] >> ",
29+
),
30+
(
31+
"First Last<fl <First Last<[email protected]>>\n",
32+
"fl <First Last<[email protected]",
33+
),
2834
] {
2935
let identity = gix_actor::IdentityRef::from_bytes::<()>(input.as_bytes()).unwrap();
3036
assert_eq!(identity.name, "First Last");
37+
assert_eq!(
38+
identity.email, expected_email,
39+
"emails are parsed but left as is for round-tripping"
40+
);
3141
let signature: Identity = identity.into();
3242
let mut output = Vec::new();
3343
let err = signature.write_to(&mut output).unwrap_err();

0 commit comments

Comments
 (0)