Skip to content

Commit

Permalink
Fix doctest failures
Browse files Browse the repository at this point in the history
Remove a doctest that doesn't make much sense -
it's trying to run the code example from within the docstring?
ref https://github.com/JuliaLang/julia/pull/15627/files#r67456024

Fix a devdocs link to a file that no longer exists on master

run contrib/add_license_to_files.jl
  • Loading branch information
tkelman committed Jun 17, 2016
1 parent e0aa3c4 commit 632e087
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 21 deletions.
2 changes: 1 addition & 1 deletion base/docs/helpdb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6753,7 +6753,7 @@ 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! at array.jl:546
in deleteat! at array.jl:547
```
"""
deleteat!(collection, itr)
Expand Down
14 changes: 6 additions & 8 deletions base/test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -174,23 +174,21 @@ Int64
julia> @code_warntype f(1,2,3)
Variables:
#self#::#f
a::Int64
b::Int64
c::Int64
<BLANKLINE>
Body:
begin # REPL[2], line 1:
unless (Base.slt_int)(1,b::Int64)::Bool goto 4
begin # none, line 1:
unless (Base.slt_int)(1,b::Int64)::Bool goto 0
return 1
4:
0:
return 1.0
end::Union{Float64,Int64}
end::UNION{FLOAT64,INT64}
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
in eval(::Module, ::Any) at ./boot.jl:226
in error at ./error.jl:21
julia> @inferred max(1,2)
2
Expand Down
2 changes: 1 addition & 1 deletion doc/devdocs/promote-op.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Fortunately, it's possible to provide such definitions via ``promote_op``::
The first one defines the promotion rule for ``+``, and the second one
for ``*``. ``AddFun``, ``MulFun``, and ``DotMulFun`` are "functor
types" defined in `functor.jl
<https://github.com/JuliaLang/julia/blob/master/base/functors.jl>`_.
<https://github.com/JuliaLang/julia/blob/release-0.4/base/functors.jl>`_.

It's worth noting that as julia's internal representation of functions
evolves, this interface may change in a future version of Julia.
2 changes: 0 additions & 2 deletions doc/manual/documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ macros and pass them to the ``@doc`` macro just as well.

Here is a more complex example, still using Markdown:

.. doctest::

"""
bar(x[, y])

Expand Down
2 changes: 1 addition & 1 deletion doc/stdlib/collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ Dequeues

julia> deleteat!([6, 5, 4, 3, 2, 1], (2, 2))
ERROR: ArgumentError: indices must be unique and sorted
in deleteat! at array.jl:546
in deleteat! at array.jl:547

.. function:: splice!(collection, index, [replacement]) -> item

Expand Down
14 changes: 6 additions & 8 deletions doc/stdlib/test.rst
Original file line number Diff line number Diff line change
Expand Up @@ -192,23 +192,21 @@ Macros

julia> @code_warntype f(1,2,3)
Variables:
#self#::#f
a::Int64
b::Int64
c::Int64

<BLANKLINE>
Body:
begin # REPL[2], line 1:
unless (Base.slt_int)(1,b::Int64)::Bool goto 4
begin # none, line 1:
unless (Base.slt_int)(1,b::Int64)::Bool goto 0
return 1
4:
0:
return 1.0
end::Union{Float64,Int64}
end::UNION{FLOAT64,INT64}

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
in eval(::Module, ::Any) at ./boot.jl:226
in error at ./error.jl:21

julia> @inferred max(1,2)
2
Expand Down
2 changes: 2 additions & 0 deletions test/bigfloat.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

@test big(2.0)^big(3) == 8

for T in [Int8, UInt8, Int16, UInt16, Int32, UInt32, Int64, UInt64, Int128, UInt128, BigInt]
Expand Down

0 comments on commit 632e087

Please sign in to comment.