summaryrefslogtreecommitdiffstats
path: root/src/tools/linkchecker/tests/valid
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/tools/linkchecker/tests/valid
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/linkchecker/tests/valid')
-rw-r--r--src/tools/linkchecker/tests/valid/inner/bar.html7
-rw-r--r--src/tools/linkchecker/tests/valid/inner/foo.html14
-rw-r--r--src/tools/linkchecker/tests/valid/inner/redir-bad.html12
-rw-r--r--src/tools/linkchecker/tests/valid/inner/redir-target.html5
-rw-r--r--src/tools/linkchecker/tests/valid/inner/redir.html11
-rw-r--r--src/tools/linkchecker/tests/valid/outer.html5
6 files changed, 54 insertions, 0 deletions
diff --git a/src/tools/linkchecker/tests/valid/inner/bar.html b/src/tools/linkchecker/tests/valid/inner/bar.html
new file mode 100644
index 000000000..4b500d78b
--- /dev/null
+++ b/src/tools/linkchecker/tests/valid/inner/bar.html
@@ -0,0 +1,7 @@
+<html>
+<body>
+
+ <h2 id="barfrag">Bar</h2>
+
+</body>
+</html>
diff --git a/src/tools/linkchecker/tests/valid/inner/foo.html b/src/tools/linkchecker/tests/valid/inner/foo.html
new file mode 100644
index 000000000..3c6a7483b
--- /dev/null
+++ b/src/tools/linkchecker/tests/valid/inner/foo.html
@@ -0,0 +1,14 @@
+<html>
+<body>
+ <a href="#localfrag">test local frag</a>
+ <a href="../outer.html">remote link</a>
+ <a href="../outer.html#somefrag">remote link with fragment</a>
+ <a href="bar.html">this book</a>
+ <a href="bar.html#barfrag">this book with fragment</a>
+ <a href="https://example.com/doesnotexist">external links not validated</a>
+ <a href="redir.html#redirfrag">Redirect</a>
+
+ <h2 id="localfrag">Local</h2>
+
+</body>
+</html>
diff --git a/src/tools/linkchecker/tests/valid/inner/redir-bad.html b/src/tools/linkchecker/tests/valid/inner/redir-bad.html
new file mode 100644
index 000000000..f32683efe
--- /dev/null
+++ b/src/tools/linkchecker/tests/valid/inner/redir-bad.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="refresh" content="0;URL=xxx">
+ <title>Redirection</title>
+</head>
+<body>
+ <p>Redirecting to <a href="xxx">xxx</a>...</p>
+ <script>location.replace("xxx" + location.search + location.hash);</script>
+ These files are skipped, but probably shouldn't be.
+</body>
+</html>
diff --git a/src/tools/linkchecker/tests/valid/inner/redir-target.html b/src/tools/linkchecker/tests/valid/inner/redir-target.html
new file mode 100644
index 000000000..bd59884a0
--- /dev/null
+++ b/src/tools/linkchecker/tests/valid/inner/redir-target.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+ <h2 id="redirfrag">Redir</h2>
+</body>
+</html>
diff --git a/src/tools/linkchecker/tests/valid/inner/redir.html b/src/tools/linkchecker/tests/valid/inner/redir.html
new file mode 100644
index 000000000..3a52a8973
--- /dev/null
+++ b/src/tools/linkchecker/tests/valid/inner/redir.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="refresh" content="0;URL=redir-target.html">
+ <title>Redirection</title>
+</head>
+<body>
+ <p>Redirecting to <a href="redir-target.html">redir-target.html</a>...</p>
+ <script>location.replace("redir-target.html" + location.search + location.hash);</script>
+</body>
+</html>
diff --git a/src/tools/linkchecker/tests/valid/outer.html b/src/tools/linkchecker/tests/valid/outer.html
new file mode 100644
index 000000000..35f799f20
--- /dev/null
+++ b/src/tools/linkchecker/tests/valid/outer.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+<a id="somefrag"></a>
+</body>
+</html>