Skip to content

Commit 70db8be

Browse files
authored
Merge pull request #21676 from JuliaLang/tk/shouldhavebeenadoctest
Minor doctest fixes
2 parents df66fe6 + 82eb74c commit 70db8be

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ matrix:
1010
sources:
1111
- ubuntu-toolchain-r-test
1212
packages:
13+
- libssl1.0.0
1314
- bar
1415
- time
1516
- binutils
@@ -29,6 +30,7 @@ matrix:
2930
sources:
3031
- ubuntu-toolchain-r-test
3132
packages:
33+
- libssl1.0.0
3234
- bar
3335
- time
3436
- g++-5

base/dates/periods.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ Construct a `CompoundPeriod` from a `Vector` of `Period`s. All `Period`s of the
199199
will be added together.
200200
201201
# Examples
202-
```julia
202+
```jldoctest
203203
julia> Dates.CompoundPeriod(Dates.Hour(12), Dates.Hour(13))
204204
25 hours
205205
@@ -232,7 +232,7 @@ Reduces the `CompoundPeriod` into its canonical form by applying the following r
232232
(eg. `Hour(1) - Day(1)` becomes `-Hour(23)`)
233233
234234
# Examples
235-
```julia
235+
```jldoctest
236236
julia> Dates.canonicalize(Dates.CompoundPeriod(Dates.Hour(12), Dates.Hour(13)))
237237
1 day, 1 hour
238238

base/linalg/dense.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ julia> A = 2.7182818 * eye(2)
546546
0.0 2.71828
547547
548548
julia> logm(A)
549-
2×2 Array{Float64,2}:
549+
2×2 Symmetric{Float64,Array{Float64,2}}:
550550
1.0 0.0
551551
0.0 1.0
552552
```

base/linalg/eigen.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ julia> A = [0 im; -1 0]
228228
julia> eigmax(A)
229229
ERROR: DomainError:
230230
Stacktrace:
231-
[1] #eigmax#38(::Bool, ::Bool, ::Function, ::Array{Complex{Int64},2}) at ./linalg/eigen.jl:238
231+
[1] #eigmax#46(::Bool, ::Bool, ::Function, ::Array{Complex{Int64},2}) at ./linalg/eigen.jl:238
232232
[2] eigmax(::Array{Complex{Int64},2}) at ./linalg/eigen.jl:236
233233
```
234234
"""
@@ -270,7 +270,7 @@ julia> A = [0 im; -1 0]
270270
julia> eigmin(A)
271271
ERROR: DomainError:
272272
Stacktrace:
273-
[1] #eigmin#39(::Bool, ::Bool, ::Function, ::Array{Complex{Int64},2}) at ./linalg/eigen.jl:280
273+
[1] #eigmin#47(::Bool, ::Bool, ::Function, ::Array{Complex{Int64},2}) at ./linalg/eigen.jl:280
274274
[2] eigmin(::Array{Complex{Int64},2}) at ./linalg/eigen.jl:278
275275
```
276276
"""

base/shell.jl

+8-5
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,16 @@ The unexported `shell_escape` function is the inverse of the unexported `shell_s
178178
it takes a string or command object and escapes any special characters in such a way that calling
179179
`shell_split` on it would give back the array of words in the original command. The `special`
180180
keyword argument controls what characters in addition to whitespace, backslashes, quotes and
181-
dollar signs are considered to be special (default: none). Examples:
181+
dollar signs are considered to be special (default: none).
182182
183-
julia> Base.shell_escape("cat", "/foo/bar baz", "&&", "echo", "done")
184-
"cat '/foo/bar baz' && echo done"
183+
# Examples
184+
```jldoctest
185+
julia> Base.shell_escape("cat", "/foo/bar baz", "&&", "echo", "done")
186+
"cat '/foo/bar baz' && echo done"
185187
186-
julia> Base.shell_escape("echo", "this", "&&", "that")
187-
"echo this '&&' that"
188+
julia> Base.shell_escape("echo", "this", "&&", "that")
189+
"echo this && that"
190+
```
188191
"""
189192
shell_escape(args::AbstractString...; special::AbstractString="") =
190193
sprint(io->print_shell_escaped(io, args..., special=special))

0 commit comments

Comments
 (0)