Add missing test for local links in plaintext files
@@ -11,6 +11,19 @@ pub(crate) fn extract_plaintext(input: &str) -> Vec<RawUri> {
mod tests {
use super::*;
+ #[test]
+ fn test_extract_local_links() {
+ let input = "http://127.0.0.1/ and http://127.0.0.1:8888/ are local links.";
+ let links: Vec<RawUri> = extract_plaintext(input);
+ assert_eq!(
+ links,
+ [
+ RawUri::from("http://127.0.0.1/"),
+ RawUri::from("http://127.0.0.1:8888/")
+ ]
+ );
+ }
+
#[test]
fn test_extract_link_at_end_of_line() {
let input = "https://www.apache.org/licenses/LICENSE-2.0\n";
