Skip to content

Commit

Permalink
Fix doctests for minor backtrace differences
Browse files Browse the repository at this point in the history
  • Loading branch information
tkelman committed Mar 1, 2017
1 parent b386767 commit f6003b4
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion base/arraymath.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ for f in (:-, :~, :conj, :sign)
end
else
for (iF, iA) in zip(RF, RA)
F[iF] = ($f)(A[iA])
F[iF] = ($f)(A[iA])
end
end
return F
Expand Down
2 changes: 1 addition & 1 deletion base/docs/helpdb/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6338,7 +6338,7 @@ julia> convert(Int, 3.0)
julia> convert(Int, 3.5)
ERROR: InexactError()
in convert(::Type{Int64}, ::Float64) at ./int.jl:239
in convert(::Type{Int64}, ::Float64) at ./float.jl:493
...
```
Expand Down
1 change: 1 addition & 0 deletions doc/manual/constructors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ types of the arguments given to the constructor. Here are some examples:

julia> Point{Int64}(1.0,2.5)
ERROR: InexactError()
in convert(::Type{Int64}, ::Float64) at ./float.jl:493
in Point{Int64}(::Float64, ::Float64) at ./none:2
...

Expand Down
4 changes: 3 additions & 1 deletion doc/manual/mathematical-operations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -408,11 +408,13 @@ The following examples show the different forms.

julia> Int8(3.14)
ERROR: InexactError()
in convert(::Type{Int8}, ::Float64) at ./float.jl:472
in Int8(::Float64) at ./sysimg.jl:53
...

julia> Int8(128.0)
ERROR: InexactError()
in convert(::Type{Int8}, ::Float64) at ./float.jl:472
in Int8(::Float64) at ./sysimg.jl:53
...

Expand All @@ -427,7 +429,7 @@ The following examples show the different forms.

julia> round(Int8,127.6)
ERROR: InexactError()
in trunc(::Type{Int8}, ::Float64) at ./float.jl:458
in trunc(::Type{Int8}, ::Float64) at ./float.jl:465
in round(::Type{Int8}, ::Float64) at ./float.jl:211
...

Expand Down
2 changes: 1 addition & 1 deletion doc/manual/stacktraces.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ alias :obj:`StackTrace` can be used in place of ``Vector{StackFrame}``. (Example
in eval_user_input(::Any, ::Bool) at client.jl:117
in eval(::Module, ::Any) at boot.jl:234
in eval_user_input(::Any, ::Bool) at client.jl:117
in _start() at client.jl:355
in _start() at client.jl:358

julia> @noinline child() = stacktrace()
child (generic function with 1 method)
Expand Down
6 changes: 3 additions & 3 deletions doc/manual/strings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,14 @@ such an invalid byte index, an error is thrown:
julia> s[2]
ERROR: UnicodeError: invalid character index
in slow_utf8_next(::Array{UInt8,1}, ::UInt8, ::Int64) at ./strings/string.jl:67
in next at ./strings/string.jl:92 [inlined]
in next at ./strings/string.jl:96 [inlined]
in getindex(::String, ::Int64) at ./strings/basic.jl:70
...

julia> s[3]
ERROR: UnicodeError: invalid character index
in slow_utf8_next(::Array{UInt8,1}, ::UInt8, ::Int64) at ./strings/string.jl:67
in next at ./strings/string.jl:92 [inlined]
in next at ./strings/string.jl:96 [inlined]
in getindex(::String, ::Int64) at ./strings/basic.jl:70
...

Expand Down Expand Up @@ -554,7 +554,7 @@ contained in a string:
julia> contains("Xylophon", 'o')
ERROR: MethodError: no method matching contains(::String, ::Char)
Closest candidates are:
contains(!Matched::Function, ::Any, !Matched::Any) at reduce.jl:489
contains(!Matched::Function, ::Any, !Matched::Any) at reduce.jl:495
contains(::AbstractString, !Matched::AbstractString) at strings/search.jl:310
...

Expand Down
1 change: 1 addition & 0 deletions doc/manual/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ However, the value for ``baz`` must be convertible to :class:`Int`:

julia> Foo((), 23.5, 1)
ERROR: InexactError()
in convert(::Type{Int64}, ::Float64) at ./float.jl:493
in Foo(::Tuple{}, ::Float64, ::Int64) at ./none:2
...

Expand Down
2 changes: 1 addition & 1 deletion doc/stdlib/base.rst
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ All Objects

julia> convert(Int, 3.5)
ERROR: InexactError()
in convert(::Type{Int64}, ::Float64) at ./int.jl:239
in convert(::Type{Int64}, ::Float64) at ./float.jl:493
...

If ``T`` is a :obj:`AbstractFloat` or :obj:`Rational` type, then it will return the closest value to ``x`` representable by ``T``\ .
Expand Down
1 change: 1 addition & 0 deletions doc/stdlib/io-network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1039,3 +1039,4 @@ Network I/O
.. Docstring generated from Julia source
The 32-bit byte-order-mark indicates the native byte order of the host machine. Little-endian machines will contain the value ``0x04030201``\ . Big-endian machines will contain the value ``0x01020304``\ .

0 comments on commit f6003b4

Please sign in to comment.