Skip to content

Commit

Permalink
fix doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed Dec 13, 2016
1 parent 3a13e76 commit 2d6643e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
3 changes: 2 additions & 1 deletion base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,8 @@ julia> deleteat!([6, 5, 4, 3, 2, 1], 1:2:5)
julia> deleteat!([6, 5, 4, 3, 2, 1], (2, 2))
ERROR: ArgumentError: indices must be unique and sorted
in deleteat!(::Array{Int64,1}, ::Tuple{Int64,Int64}) at ./array.jl:747
Stacktrace:
[1] deleteat!(::Array{Int64,1}, ::Tuple{Int64,Int64}) at ./array.jl:748
```
"""
function deleteat!(a::Vector, inds)
Expand Down
6 changes: 4 additions & 2 deletions base/docs/helpdb/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,8 @@ If `T` is not a bitstype, an error is thrown.
```jldoctest
julia> sizeof(Base.LinAlg.LU)
ERROR: argument is an abstract type; size is indeterminate
in sizeof(::Type{T}) at ./essentials.jl:99
Stacktrace:
[1] sizeof(::Type{T}) at ./essentials.jl:99
```
"""
sizeof(::Type)
Expand Down Expand Up @@ -2685,7 +2686,8 @@ julia> convert(Int, 3.0)
julia> convert(Int, 3.5)
ERROR: InexactError()
in convert(::Type{Int64}, ::Float64) at ./float.jl:656
Stacktrace:
[1] convert(::Type{Int64}, ::Float64) at ./float.jl:656
```
If `T` is a `AbstractFloat` or `Rational` type,
Expand Down
10 changes: 6 additions & 4 deletions base/linalg/eigen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,9 @@ julia> A = [0 im; -1 0]
julia> eigmax(A)
ERROR: DomainError:
in #eigmax#30(::Bool, ::Bool, ::Function, ::Array{Complex{Int64},2}) at ./linalg/eigen.jl:218
in eigmax(::Array{Complex{Int64},2}) at ./linalg/eigen.jl:216
Stacktrace:
[1] #eigmax#30(::Bool, ::Bool, ::Function, ::Array{Complex{Int64},2}) at ./linalg/eigen.jl:219
[2] eigmax(::Array{Complex{Int64},2}) at ./linalg/eigen.jl:217
```
"""
function eigmax(A::Union{Number, StridedMatrix}; permute::Bool=true, scale::Bool=true)
Expand Down Expand Up @@ -249,8 +250,9 @@ julia> A = [0 im; -1 0]
julia> eigmin(A)
ERROR: DomainError:
in #eigmin#31(::Bool, ::Bool, ::Function, ::Array{Complex{Int64},2}) at ./linalg/eigen.jl:259
in eigmin(::Array{Complex{Int64},2}) at ./linalg/eigen.jl:257
Stacktrace:
[1] #eigmin#31(::Bool, ::Bool, ::Function, ::Array{Complex{Int64},2}) at ./linalg/eigen.jl:261
[2] eigmin(::Array{Complex{Int64},2}) at ./linalg/eigen.jl:259
```
"""
function eigmin(A::Union{Number, StridedMatrix}; permute::Bool=true, scale::Bool=true)
Expand Down
3 changes: 2 additions & 1 deletion base/nullable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ Nullable{String}()
julia> unsafe_get(x)
ERROR: UndefRefError: access to undefined reference
in unsafe_get(::Nullable{String}) at ./nullable.jl:123
Stacktrace:
[1] unsafe_get(::Nullable{String}) at ./nullable.jl:124
julia> x = 1
1
Expand Down
3 changes: 2 additions & 1 deletion base/test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,8 @@ Body:
julia> @inferred f(1,2,3)
ERROR: return type Int64 does not match inferred return type Union{Float64,Int64}
in error(::String) at ./error.jl:21
Stacktrace:
[1] error(::String) at ./error.jl:21
julia> @inferred max(1,2)
2
Expand Down

0 comments on commit 2d6643e

Please sign in to comment.