mirror of
https://github.com/Hopiu/lychee.git
synced 2026-03-16 20:50:25 +00:00
test: add tests for URL extraction ending with a period (#1641)
This commit is contained in:
parent
b1cb2564a2
commit
d33b7554a1
2 changed files with 26 additions and 0 deletions
1
fixtures/LINK_PERIOD.html
vendored
Normal file
1
fixtures/LINK_PERIOD.html
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
<a href="https://www.example.com/smth.">link</a>
|
||||
|
|
@ -1990,4 +1990,29 @@ mod cli {
|
|||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_extract_url_ending_with_period_file() {
|
||||
let test_path = fixtures_path().join("LINK_PERIOD.html");
|
||||
|
||||
let mut cmd = main_command();
|
||||
cmd.arg("--dump")
|
||||
.arg(test_path)
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(contains("https://www.example.com/smth."));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_extract_url_ending_with_period_webserver() {
|
||||
let mut cmd = main_command();
|
||||
let body = r#"<a href="https://www.example.com/smth.">link</a>"#;
|
||||
let mock_server = mock_response!(body);
|
||||
|
||||
cmd.arg("--dump")
|
||||
.arg(mock_server.uri())
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(contains("https://www.example.com/smth."));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue