Skip to content

Commit 98a093a

Browse files
committed
Move redirect gui tests to its own book
1 parent 9b5c57b commit 98a093a

File tree

8 files changed

+65
-53
lines changed

8 files changed

+65
-53
lines changed

tests/gui/books/redirect/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Redirect
2+
3+
This GUI test book tests the redirect configuration.

tests/gui/books/redirect/book.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[book]
2+
title = "redirect"
3+
4+
[output.html.redirect]
5+
"/inner/old.html" = "../new-chapter.html"
6+
7+
# This is a source without a fragment, and one with a fragment that goes to
8+
# the same place. The redirect with the fragment is not necessary, since that
9+
# is the default behavior.
10+
"/pointless-fragment.html" = "new-chapter.html"
11+
"/pointless-fragment.html#foo" = "new-chapter.html#foo"
12+
13+
"/rename-page-and-fragment.html" = "new-chapter.html"
14+
"/rename-page-and-fragment.html#orig" = "new-chapter.html#new"
15+
16+
"/rename-page-fragment-elsewhere.html" = "new-chapter.html"
17+
"/rename-page-fragment-elsewhere.html#orig" = "other-chapter.html#new"
18+
19+
# Rename fragment on an existing page.
20+
"/new-chapter.html#orig" = "new-chapter.html#new"
21+
# Rename fragment on an existing page to another page.
22+
"/new-chapter.html#orig-new-chapter" = "other-chapter.html#new"
23+
24+
"/full-url-with-fragment.html" = "https://www.rust-lang.org/#fragment"
25+
26+
"/full-url-with-fragment-map.html" = "https://www.rust-lang.org/"
27+
"/full-url-with-fragment-map.html#a" = "https://www.rust-lang.org/#new1"
28+
"/full-url-with-fragment-map.html#b" = "https://www.rust-lang.org/#new2"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Summary
2+
3+
- [New chapter](new-chapter.md)
4+
- [Other chapter](other-chapter.md)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Chapter 1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# New chapter
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Other chapter

tests/gui/books/test_book/book.toml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,3 @@ boost-hierarchy = 2
2323
boost-paragraph = 1
2424
expand = true
2525
heading-split-level = 2
26-
27-
[output.html.redirect]
28-
"/format/config.html" = "../prefix.html"
29-
30-
# This is a source without a fragment, and one with a fragment that goes to
31-
# the same place. The redirect with the fragment is not necessary, since that
32-
# is the default behavior.
33-
"/pointless-fragment.html" = "prefix.html"
34-
"/pointless-fragment.html#foo" = "prefix.html#foo"
35-
36-
"/rename-page-and-fragment.html" = "prefix.html"
37-
"/rename-page-and-fragment.html#orig" = "prefix.html#new"
38-
39-
"/rename-page-fragment-elsewhere.html" = "prefix.html"
40-
"/rename-page-fragment-elsewhere.html#orig" = "suffix.html#new"
41-
42-
# Rename fragment on an existing page.
43-
"/prefix.html#orig" = "prefix.html#new"
44-
# Rename fragment on an existing page to another page.
45-
"/prefix.html#orig-new-page" = "suffix.html#new"
46-
47-
"/full-url-with-fragment.html" = "https://www.rust-lang.org/#fragment"
48-
49-
"/full-url-with-fragment-map.html" = "https://www.rust-lang.org/"
50-
"/full-url-with-fragment-map.html#a" = "https://www.rust-lang.org/#new1"
51-
"/full-url-with-fragment-map.html#b" = "https://www.rust-lang.org/#new2"

tests/gui/redirect.goml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
go-to: |DOC_PATH| + "test_book/format/config.html"
2-
assert-window-property: ({"location": |DOC_PATH| + "test_book/prefix.html"})
1+
go-to: |DOC_PATH| + "redirect/inner/old.html"
2+
assert-window-property: ({"location": |DOC_PATH| + "redirect/new-chapter.html"})
33

44
// Check that it preserves fragments when redirecting.
5-
go-to: |DOC_PATH| + "test_book/format/config.html#fragment"
6-
assert-window-property: ({"location": |DOC_PATH| + "test_book/prefix.html#fragment"})
5+
go-to: |DOC_PATH| + "redirect/inner/old.html#fragment"
6+
assert-window-property: ({"location": |DOC_PATH| + "redirect/new-chapter.html#fragment"})
77

88
// The fragment one here isn't necessary, but should still work.
9-
go-to: |DOC_PATH| + "test_book/pointless-fragment.html"
10-
assert-window-property: ({"location": |DOC_PATH| + "test_book/prefix.html"})
11-
go-to: |DOC_PATH| + "test_book/pointless-fragment.html#foo"
12-
assert-window-property: ({"location": |DOC_PATH| + "test_book/prefix.html#foo"})
9+
go-to: |DOC_PATH| + "redirect/pointless-fragment.html"
10+
assert-window-property: ({"location": |DOC_PATH| + "redirect/new-chapter.html"})
11+
go-to: |DOC_PATH| + "redirect/pointless-fragment.html#foo"
12+
assert-window-property: ({"location": |DOC_PATH| + "redirect/new-chapter.html#foo"})
1313

1414
// Page rename, and a fragment rename.
15-
go-to: |DOC_PATH| + "test_book/rename-page-and-fragment.html"
16-
assert-window-property: ({"location": |DOC_PATH| + "test_book/prefix.html"})
17-
go-to: |DOC_PATH| + "test_book/rename-page-and-fragment.html#orig"
18-
assert-window-property: ({"location": |DOC_PATH| + "test_book/prefix.html#new"})
15+
go-to: |DOC_PATH| + "redirect/rename-page-and-fragment.html"
16+
assert-window-property: ({"location": |DOC_PATH| + "redirect/new-chapter.html"})
17+
go-to: |DOC_PATH| + "redirect/rename-page-and-fragment.html#orig"
18+
assert-window-property: ({"location": |DOC_PATH| + "redirect/new-chapter.html#new"})
1919

2020
// Page rename, and the fragment goes to a *different* page from the default.
21-
go-to: |DOC_PATH| + "test_book/rename-page-fragment-elsewhere.html"
22-
assert-window-property: ({"location": |DOC_PATH| + "test_book/prefix.html"})
23-
go-to: |DOC_PATH| + "test_book/rename-page-fragment-elsewhere.html#orig"
24-
assert-window-property: ({"location": |DOC_PATH| + "test_book/suffix.html#new"})
21+
go-to: |DOC_PATH| + "redirect/rename-page-fragment-elsewhere.html"
22+
assert-window-property: ({"location": |DOC_PATH| + "redirect/new-chapter.html"})
23+
go-to: |DOC_PATH| + "redirect/rename-page-fragment-elsewhere.html#orig"
24+
assert-window-property: ({"location": |DOC_PATH| + "redirect/other-chapter.html#new"})
2525

2626
// Rename fragment on an existing page.
27-
go-to: |DOC_PATH| + "test_book/prefix.html#orig"
28-
assert-window-property: ({"location": |DOC_PATH| + "test_book/prefix.html#new"})
27+
go-to: |DOC_PATH| + "redirect/new-chapter.html#orig"
28+
assert-window-property: ({"location": |DOC_PATH| + "redirect/new-chapter.html#new"})
2929

3030
// Other fragments aren't affected.
31-
go-to: |DOC_PATH| + "test_book/index.html" // Reset page since redirects are processed on load.
32-
go-to: |DOC_PATH| + "test_book/prefix.html"
33-
assert-window-property: ({"location": |DOC_PATH| + "test_book/prefix.html"})
34-
go-to: |DOC_PATH| + "test_book/index.html" // Reset page since redirects are processed on load.
35-
go-to: |DOC_PATH| + "test_book/prefix.html#dont-change"
36-
assert-window-property: ({"location": |DOC_PATH| + "test_book/prefix.html#dont-change"})
31+
go-to: |DOC_PATH| + "redirect/index.html" // Reset page since redirects are processed on load.
32+
go-to: |DOC_PATH| + "redirect/new-chapter.html"
33+
assert-window-property: ({"location": |DOC_PATH| + "redirect/new-chapter.html"})
34+
go-to: |DOC_PATH| + "redirect/index.html" // Reset page since redirects are processed on load.
35+
go-to: |DOC_PATH| + "redirect/new-chapter.html#dont-change"
36+
assert-window-property: ({"location": |DOC_PATH| + "redirect/new-chapter.html#dont-change"})
3737

3838
// Rename fragment on an existing page to another page.
39-
go-to: |DOC_PATH| + "test_book/index.html" // Reset page since redirects are processed on load.
40-
go-to: |DOC_PATH| + "test_book/prefix.html#orig-new-page"
41-
assert-window-property: ({"location": |DOC_PATH| + "test_book/suffix.html#new"})
39+
go-to: |DOC_PATH| + "redirect/index.html" // Reset page since redirects are processed on load.
40+
go-to: |DOC_PATH| + "redirect/new-chapter.html#orig-new-chapter"
41+
assert-window-property: ({"location": |DOC_PATH| + "redirect/other-chapter.html#new"})

0 commit comments

Comments
 (0)