You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/test_bibliography_block_pages.jl
+23-17Lines changed: 23 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ include("file_content.jl")
8
8
9
9
# regex for strings containing paths
10
10
functionprx(s)
11
-
rx =s
11
+
rx =escape_string(s)
12
12
# work around limitations of `replace` in Julia 1.6
13
13
for mapping in ["["=>"\\[", "]"=>"\\]", "."=>"\\.", "/"=>"\\W*"]
14
14
# The mapping for path separators ("/") to "\W*" (sequence of non-word
@@ -56,14 +56,17 @@ end
56
56
57
57
@test success
58
58
#! format: off
59
-
@test_brokencontains(output, prx("Error: Invalid \"index.md\" in Pages attribute of @bibliography block on page $(rp)src/part3/section2/invalidpages.md: No such file \"src/part3/section2/index.md\"."))
60
-
@testcontains(output, prx("Warning: The entry \"index.md\" in the Pages attribute of the @bibliography block on page $(rp)src/part3/section2/invalidpages.md:7-14 appears to be relative to \"src\"."))
61
-
@testcontains(output, prx("Error: Invalid \"p3_s1_page.md\" in Pages attribute of @bibliography block on page $(rp)src/part3/section2/invalidpages.md:7-14: No such file \"src/part3/section2/p3_s1_page.md\"."))
62
-
@testcontains(output, prx("Error: Invalid \"noexist.md\" in Pages attribute of @bibliography block on page $(rp)src/part3/section2/invalidpages.md:7-14: No such file \"src/part3/section2/noexist.md\"."))
63
-
@testcontains(output, "Warning: No cited keys remaining after filtering to Pages")
64
-
@testcontains(output, prx("Error: Invalid \"../../addendum.md\" in Pages attribute of @bibliography block on page $(rp)src/part3/section2/invalidpages.md:20-25: File \"src/addendum.md\" exists but no references were collected."))
65
-
@testcontains(output, prx("Error: Invalid \"p3_s1_page.md\" in Pages attribute of @bibliography block on page $(rp)src/part3/section2/invalidpages.md:29-35: No such file \"src/part3/section2/p3_s1_page.md\"."))
66
-
@testcontains(output, prx("Warning: The field `Pages` in $(rp)src/part3/section2/invalidpages.md:41-44 must evaluate to a list of strings. Setting invalid `Pages = \"none\"` to `Pages = []`"))
59
+
if Sys.isunix()
60
+
# These regexes are impossible to get right on Windows
61
+
@test_brokencontains(output, prx("Error: Invalid \"index.md\" in Pages attribute of @bibliography block on page $(rp)src/part3/section2/invalidpages.md: No such file \"src/part3/section2/index.md\"."))
62
+
@testcontains(output, prx("Warning: The entry \"index.md\" in the Pages attribute of the @bibliography block on page $(rp)src/part3/section2/invalidpages.md:7-14 appears to be relative to \"src\"."))
63
+
@testcontains(output, prx("Error: Invalid \"p3_s1_page.md\" in Pages attribute of @bibliography block on page $(rp)src/part3/section2/invalidpages.md:7-14: No such file \"src/part3/section2/p3_s1_page.md\"."))
64
+
@testcontains(output, prx("Error: Invalid \"noexist.md\" in Pages attribute of @bibliography block on page $(rp)src/part3/section2/invalidpages.md:7-14: No such file \"src/part3/section2/noexist.md\"."))
65
+
@testcontains(output, "Warning: No cited keys remaining after filtering to Pages")
66
+
@testcontains(output, prx("Error: Invalid \"../../addendum.md\" in Pages attribute of @bibliography block on page $(rp)src/part3/section2/invalidpages.md:20-25: File \"src/addendum.md\" exists but no references were collected."))
67
+
@testcontains(output, prx("Error: Invalid \"p3_s1_page.md\" in Pages attribute of @bibliography block on page $(rp)src/part3/section2/invalidpages.md:29-35: No such file \"src/part3/section2/p3_s1_page.md\"."))
68
+
@testcontains(output, prx("Warning: The field `Pages` in $(rp)src/part3/section2/invalidpages.md:41-44 must evaluate to a list of strings. Setting invalid `Pages = \"none\"` to `Pages = []`"))
69
+
end
67
70
#! format: on
68
71
69
72
build(paths...) =joinpath(dir, "build", paths...)
@@ -192,14 +195,17 @@ end
192
195
193
196
@test!success
194
197
#! format: off
195
-
@test_brokencontains(output, prx("Error: Invalid \"index.md\" in Pages attribute of @bibliography block on page $(rp)src/part3/section2/invalidpages.md:7-14: No such file \"src/part3/section2/index.md\"."))
196
-
@testcontains(output, prx("Warning: The entry \"index.md\" in the Pages attribute of the @bibliography block on page $(rp)src/part3/section2/invalidpages.md:7-14 appears to be relative to \"src\"."))
197
-
@testcontains(output, prx("Error: Invalid \"p3_s1_page.md\" in Pages attribute of @bibliography block on page $(rp)src/part3/section2/invalidpages.md:7-14: No such file \"src/part3/section2/p3_s1_page.md\"."))
198
-
@testcontains(output, prx("Error: Invalid \"noexist.md\" in Pages attribute of @bibliography block on page $(rp)src/part3/section2/invalidpages.md:7-14: No such file \"src/part3/section2/noexist.md\"."))
199
-
@testcontains(output, "Warning: No cited keys remaining after filtering to Pages")
200
-
@testcontains(output, prx("Error: Invalid \"../../addendum.md\" in Pages attribute of @bibliography block on page $(rp)src/part3/section2/invalidpages.md:20-25: File \"src/addendum.md\" exists but no references were collected."))
201
-
@testcontains(output, prx("Error: Invalid \"p3_s1_page.md\" in Pages attribute of @bibliography block on page $(rp)src/part3/section2/invalidpages.md:29-35: No such file \"src/part3/section2/p3_s1_page.md\"."))
202
-
@testcontains(output, prx("Warning: The field `Pages` in $(rp)src/part3/section2/invalidpages.md:41-44 must evaluate to a list of strings. Setting invalid `Pages = \"none\"` to `Pages = []`"))
198
+
if Sys.isunix()
199
+
# These regexes are impossible to get right on Windows
200
+
@test_brokencontains(output, prx("Error: Invalid \"index.md\" in Pages attribute of @bibliography block on page $(rp)src/part3/section2/invalidpages.md:7-14: No such file \"src/part3/section2/index.md\"."))
201
+
@testcontains(output, prx("Warning: The entry \"index.md\" in the Pages attribute of the @bibliography block on page $(rp)src/part3/section2/invalidpages.md:7-14 appears to be relative to \"src\"."))
202
+
@testcontains(output, prx("Error: Invalid \"p3_s1_page.md\" in Pages attribute of @bibliography block on page $(rp)src/part3/section2/invalidpages.md:7-14: No such file \"src/part3/section2/p3_s1_page.md\"."))
203
+
@testcontains(output, prx("Error: Invalid \"noexist.md\" in Pages attribute of @bibliography block on page $(rp)src/part3/section2/invalidpages.md:7-14: No such file \"src/part3/section2/noexist.md\"."))
204
+
@testcontains(output, "Warning: No cited keys remaining after filtering to Pages")
205
+
@testcontains(output, prx("Error: Invalid \"../../addendum.md\" in Pages attribute of @bibliography block on page $(rp)src/part3/section2/invalidpages.md:20-25: File \"src/addendum.md\" exists but no references were collected."))
206
+
@testcontains(output, prx("Error: Invalid \"p3_s1_page.md\" in Pages attribute of @bibliography block on page $(rp)src/part3/section2/invalidpages.md:29-35: No such file \"src/part3/section2/p3_s1_page.md\"."))
207
+
@testcontains(output, prx("Warning: The field `Pages` in $(rp)src/part3/section2/invalidpages.md:41-44 must evaluate to a list of strings. Setting invalid `Pages = \"none\"` to `Pages = []`"))
208
+
end
203
209
#! format: on
204
210
@test result isa ErrorException
205
211
@testoccursin("`makedocs` encountered an error [:bibliography_block]", result.msg)
0 commit comments