Skip to content

Commit

Permalink
Test ipv6 endpoint parsing (#809)
Browse files Browse the repository at this point in the history
Co-authored-by: Oleg Pudeyev <[email protected]>
Co-authored-by: Ivo Anjo <[email protected]>
  • Loading branch information
3 people authored Jan 3, 2025
1 parent 9bd62bb commit 872c109
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ddcommon-ffi/src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,17 @@ mod tests {
("file:/// file / with/weird chars 🤡", true),
("file://./", true),
("unix://./", true),
("http://2001:db8:1::2:8126/", false),
("http://[2001:db8:1::2]:8126/", true),
];

for (input, expected) in cases {
let actual = ddog_endpoint_from_url(CharSlice::from(input)).is_some();
let ep = ddog_endpoint_from_url(CharSlice::from(input));
let actual = ep.is_some();
assert_eq!(actual, expected);
if actual {
ddog_endpoint_drop(ep.unwrap());
}
}
}

Expand Down

0 comments on commit 872c109

Please sign in to comment.