Skip to content

Commit

Permalink
Increasing the coverage of generic_getLinks()
Browse files Browse the repository at this point in the history
  • Loading branch information
veloman-yunkan committed Nov 14, 2023
1 parent b69ff3a commit 64fd8e6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/tools-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,8 @@ TEST(tools, getLinks)
R"(
<html>
<head>
<link src="/css/stylesheet.css" rel="stylesheet">
<link rel="icon" href="/favicon.ico">
<link src = "/css/stylesheet.css" rel="stylesheet">
<link rel="icon" href = '/favicon.ico'>
</head>
<body>
<img src="../img/welcome.png">
Expand All @@ -390,6 +390,15 @@ TEST(tools, getLinks)
"{ src, not_a_link_in_example_code_block.png }" "\n"
"{ href, https://kiwix.org }"
);

// Despite HTML not being properly parsed, not every href or src followed
// by an equality sign (with optional whitespace in between) results in a
// link
EXPECT_LINKS(
"abcd href = qwerty src={123} xyz",
""
);

Check notice on line 401 in test/tools-test.cpp

View check run for this annotation

codefactor.io / CodeFactor

test/tools-test.cpp#L401

Redundant blank line at the end of a code block should be deleted. (whitespace/blank_line)
}
#undef EXPECT_LINKS

Expand Down

0 comments on commit 64fd8e6

Please sign in to comment.