Skip to content

Commit f634965

Browse files
authored
Add test for 'Unexpected Julia interpolation' warnings (#2818)
1 parent 2bac6f5 commit f634965

File tree

3 files changed

+40
-8
lines changed

3 files changed

+40
-8
lines changed

test/examples/src/index.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -614,14 +614,6 @@ Also in block quotes:
614614
> ##### Heading 5
615615
> ###### Heading 6
616616
617-
# JuliaValue
618-
619-
It is possible to create pseudo-interpolations with the `Markdown` parser: $foo.
620-
621-
$([1 2 3; 4 5 6])
622-
623-
They do not get evaluated.
624-
625617
# Admonitions
626618
627619
!!! note "'note' admonition"

test/warnings/make.jl

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,39 @@ julia> WarningTests.run_warnings_test("at-docs")
6464
"""
6565
module AtDocsWarningTests end
6666

67+
@doc raw"""
68+
```jldoctest; setup=:(using ..WarningTests)
69+
julia> WarningTests.run_warnings_test("dollar")
70+
[ Info: SetupBuildDirectory: setting up build directory.
71+
[ Info: Doctest: running doctests.
72+
[ Info: ExpandTemplates: expanding markdown templates.
73+
[ Info: CrossReferences: building cross-references.
74+
[ Info: CheckDocument: running document checks.
75+
[ Info: Populate: populating indices.
76+
[ Info: RenderDocument: rendering document.
77+
[ Info: HTMLWriter: rendering HTML pages.
78+
┌ Warning: Unexpected Julia interpolation in the Markdown. This probably means that you have an
79+
│ unbalanced or un-escaped $ in the text.
80+
81+
│ To write the dollar sign, escape it with `\$`
82+
83+
│ We don't have the file or line number available, but we got given the value:
84+
85+
│ `foo` which is of type `Symbol`
86+
└ @ Documenter
87+
┌ Warning: Unexpected Julia interpolation in the Markdown. This probably means that you have an
88+
│ unbalanced or un-escaped $ in the text.
89+
90+
│ To write the dollar sign, escape it with `\$`
91+
92+
│ We don't have the file or line number available, but we got given the value:
93+
94+
│ `[1 2 3; 4 5 6]` which is of type `Expr`
95+
└ @ Documenter
96+
```
97+
"""
98+
module UnbalancedDollarWarningTests end
99+
67100
fixtests = haskey(ENV, "DOCUMENTER_FIXTESTS")
68101

69102
# run the doctests in Julia >= 1.10 (some outputs have minor difference in

test/warnings/src/dollar.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# JuliaValue
2+
3+
It is possible to create pseudo-interpolations with the `Markdown` parser: $foo.
4+
5+
$([1 2 3; 4 5 6])
6+
7+
They do not get evaluated.

0 commit comments

Comments
 (0)