Skip to content

Commit

Permalink
Merge pull request #24695 from JuliaLang/ksh/basedocstests
Browse files Browse the repository at this point in the history
Some doctests for basedocs
  • Loading branch information
kshyatt authored Nov 23, 2017
2 parents b18ff77 + 51ca5d7 commit d3cab22
Showing 1 changed file with 108 additions and 5 deletions.
113 changes: 108 additions & 5 deletions base/docs/basedocs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ Void
nothing
The singleton instance of type `Void`, used by convention when there is no value to return
(as in a C `void` function). Can be converted to an empty `Nullable` value.
(as in a C `void` function). Can be converted to an empty [`Nullable`](@ref) value.
"""
nothing

Expand Down Expand Up @@ -876,7 +876,7 @@ UndefRefError
"""
Float32(x [, mode::RoundingMode])
Create a Float32 from `x`. If `x` is not exactly representable then `mode` determines how
Create a `Float32` from `x`. If `x` is not exactly representable then `mode` determines how
`x` is rounded.
# Examples
Expand All @@ -895,7 +895,7 @@ Float32(x)
"""
Float64(x [, mode::RoundingMode])
Create a Float64 from `x`. If `x` is not exactly representable then `mode` determines how
Create a `Float64` from `x`. If `x` is not exactly representable then `mode` determines how
`x` is rounded.
# Examples
Expand Down Expand Up @@ -983,7 +983,7 @@ DomainError
"""
Task(func)
Create a `Task` (i.e. coroutine) to execute the given function (which must be
Create a `Task` (i.e. coroutine) to execute the given function `func` (which must be
callable with no arguments). The task exits when this function returns.
# Examples
Expand Down Expand Up @@ -1087,6 +1087,24 @@ invoke
Determine whether `x` is of the given `type`. Can also be used as an infix operator, e.g.
`x isa type`.
# Examples
```jldoctest
julia> isa(1, Int)
true
julia> isa(1, Matrix)
false
julia> isa(1, Char)
false
julia> isa(1, Number)
true
julia> 1 isa Number
true
```
"""
isa

Expand Down Expand Up @@ -1190,6 +1208,15 @@ end
Symbol(x...) -> Symbol
Create a `Symbol` by concatenating the string representations of the arguments together.
# Examples
```jldoctest
julia> Symbol("my", "name")
:myname
julia> Symbol("day", 4)
:day4
```
"""
Symbol

Expand Down Expand Up @@ -1219,6 +1246,9 @@ julia> a = 1//2
julia> getfield(a, :num)
1
julia> a.num
1
```
"""
getfield
Expand All @@ -1227,7 +1257,27 @@ getfield
setfield!(value, name::Symbol, x)
Assign `x` to a named field in `value` of composite type. The syntax `a.b = c` calls
`setfield!(a, :b, c)`.
`setfield!(a, :b, c)`. `value` must be mutable.
# Examples
```jldoctest
julia> mutable struct MyMutableStruct
field::Int
end
julia> a = MyMutableStruct(1);
julia> setfield!(a, :field, 2);
julia> getfield(a, :field)
2
julia> a = 1//2
1//2
julia> setfield!(a, :num, 3);
ERROR: type Rational is immutable
```
"""
setfield!

Expand Down Expand Up @@ -1346,27 +1396,68 @@ uninitialized
+(x, y...)
Addition operator. `x+y+z+...` calls this function with all arguments, i.e. `+(x, y, z, ...)`.
# Examples
```jldoctest
julia> 1 + 20 + 4
25
julia> +(1, 20, 4)
25
```
"""
(+)(x, y...)

"""
-(x)
Unary minus operator.
# Examples
```jldoctest
julia> -1
-1
julia> -(2)
-2
julia> -[1 2; 3 4]
2×2 Array{Int64,2}:
-1 -2
-3 -4
```
"""
-(x)

"""
-(x, y)
Subtraction operator.
# Examples
```jldoctest
julia> 2 - 3
-1
julia> -(2, 4.5)
-2.5
```
"""
-(x, y)

"""
*(x, y...)
Multiplication operator. `x*y*z*...` calls this function with all arguments, i.e. `*(x, y, z, ...)`.
# Examples
```jldoctest
julia> 2 * 7 * 8
112
julia> *(2, 7, 8)
112
```
"""
(*)(x, y...)

Expand All @@ -1375,6 +1466,18 @@ Multiplication operator. `x*y*z*...` calls this function with all arguments, i.e
Right division operator: multiplication of `x` by the inverse of `y` on the right. Gives
floating-point results for integer arguments.
# Examples
```jldoctest
julia> 1/2
0.5
julia> 4/2
2.0
julia> 4.5/2
2.25
```
"""
/(x, y)

Expand Down

2 comments on commit d3cab22

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something went wrong when running your job:

NanosoldierError: failed to run benchmarks against primary commit: failed process: Process(`sudo cset shield -e su nanosoldier -- -c ./benchscript.sh`, ProcessExited(1)) [1]

Logs and partial data can be found here
cc @ararslan

Please sign in to comment.