Skip to content

Commit

Permalink
Add test case for skipping external URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
filiph committed Nov 4, 2018
1 parent 6fc704e commit 0b7a581
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/case12/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<a href="subdirectory/other.html">Other</a>
<a href="https://groups.google.com/forum/#!forum/flutter-dev">Flutter</a>
</body>
</html>
1 change: 1 addition & 0 deletions test/case12/skip-file.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
forum/flutter-dev
11 changes: 11 additions & 0 deletions test/case12/subdirectory/other.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<a href="../index.html">Home</a>
<a href="https://groups.google.com/forum/#!forum/flutter-dev">Flutter</a>
</body>
</html>
14 changes: 14 additions & 0 deletions test/e2e_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,20 @@ void main() {
}
});

test("skips external URLs according to their resolved URL with fragment",
() async {
var server = await Dhttpd.start(path: getServingPath(12), port: port);
try {
int result = await run(
[":$port", "-e", "--skip-file", "test/case12/skip-file.txt"], out);
expect(result, 0);
expect(out.output, contains("0 warnings"));
expect(out.output, contains("0 errors"));
} finally {
await server.destroy();
}
});

test("works with unicode in title", () async {
var server = await Dhttpd.start(path: getServingPath(9), port: port);
try {
Expand Down

0 comments on commit 0b7a581

Please sign in to comment.