-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
a bunch of random doctests #20608
a bunch of random doctests #20608
Conversation
julia> iob64_decode = Base64DecodePipe(io); | ||
|
||
julia> write(io, "SGVsbG8h") | ||
0x0000000000000008 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strange that the return type is inconsistent for write
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it? Inconsistent with what?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
write on the Base64EncodePipe above returns signed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, interesting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could make this an Int
Line 325 in 769d37b
written = min(nb, length(to.data) - ptr + 1) |
base/cartesian.jl
Outdated
@@ -13,22 +13,22 @@ export @nloops, @nref, @ncall, @nexprs, @nextract, @nall, @nany, @ntuple, @nif | |||
|
|||
Generate `N` nested loops, using `itersym` as the prefix for the iteration variables. | |||
`rangeexpr` may be an anonymous-function expression, or a simple symbol `var` in which case | |||
the range is `1:size(var,d)` for dimension `d`. | |||
the range is `1:indices(var, d)` for dimension `d`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't indices itself a range?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, should just be indices(var, d)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed now
2.18425e-314 2.18425e-314 2.18425e-314 2.18425e-314 | ||
2.18425e-314 2.18425e-314 2.18425e-314 2.18425e-314 | ||
```julia | ||
julia> similar(falses(10), Float64, 2, 4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will we always get the same (tiny) numbers for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will depend on uninitialized memory but it's a ```julia
block, not a ```jldoctest
@@ -281,6 +283,25 @@ getindex(v::SimpleVector, I::AbstractArray) = Core.svec(Any[ v[i] for i in I ].. | |||
|
|||
Tests whether the given array has a value associated with index `i`. Returns `false` | |||
if the index is out of bounds, or has an undefined reference. | |||
|
|||
```jldoctest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to use rand
here? I guess it doesn't really matter because you never look at the values but as a style thing...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it bad style with rand
? What would you suggest changing it to? ones
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think rand
is used on other places as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this.
@kshyatt Can you merge if all ok? |
base/essentials.jl
Outdated
julia> isassigned(rand(3, 3), 3 * 3 + 1) | ||
false | ||
|
||
julia> type Foo end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mutable struct
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wops, indeed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
Also fixes up some previous buggy doctests (by me), the printing and line numbers.
All doctests now pass again.