Skip to content
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

Merged
merged 5 commits into from
Feb 15, 2017
Merged

a bunch of random doctests #20608

merged 5 commits into from
Feb 15, 2017

Conversation

KristofferC
Copy link
Sponsor Member

Also fixes up some previous buggy doctests (by me), the printing and line numbers.

All doctests now pass again.

@KristofferC KristofferC added domain:docs This change adds or pertains to documentation test This change adds or pertains to unit tests labels Feb 14, 2017
julia> iob64_decode = Base64DecodePipe(io);

julia> write(io, "SGVsbG8h")
0x0000000000000008
Copy link
Contributor

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

Copy link
Sponsor Member Author

@KristofferC KristofferC Feb 14, 2017

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?

Copy link
Contributor

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

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

Ah, interesting.

Copy link
Sponsor Member Author

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

written = min(nb, length(to.data) - ptr + 1)
?

@@ -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`.
Copy link
Contributor

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?

Copy link
Sponsor Member Author

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).

Copy link
Sponsor Member Author

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)
Copy link
Contributor

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?

Copy link
Contributor

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
Copy link
Contributor

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...

Copy link
Sponsor Member Author

@KristofferC KristofferC Feb 15, 2017

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?

Copy link
Member

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.

Copy link
Contributor

@kshyatt kshyatt left a 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.

@ViralBShah
Copy link
Member

@kshyatt Can you merge if all ok?

julia> isassigned(rand(3, 3), 3 * 3 + 1)
false

julia> type Foo end
Copy link
Member

Choose a reason for hiding this comment

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

mutable struct?

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

Wops, indeed!

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

updated

@KristofferC KristofferC merged commit cb1aae9 into master Feb 15, 2017
@KristofferC KristofferC deleted the kc/the_doctest_hunter branch February 15, 2017 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:docs This change adds or pertains to documentation test This change adds or pertains to unit tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants