-
-
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
Add tests for some untested methods #9674
Conversation
This is great, many thanks. We certainly need every function tested. Could you move the tests in |
I was using |
@JeffBezanson will do, I wasn't sure what the convention was... I created those files as that was where those methods were defined (i.e. base/int.jl rather than base/intfuncs.jl) :s Edit: yup, stupid to have 2 or 3 line test files... I must've been feeling ambitious when I opened them! Will fix up the test failure(s), thought I had tested those locally, whoops. |
04c20fc
to
5fa17ab
Compare
@@ -0,0 +1,5 @@ | |||
@test @unix_only expanduser("~")[1] != ENV["HOME"] |
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.
this should be @unix_only
@test
(though not sure whether the @unix_only
is needed)?
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.
On Windows, expanduser
does nothing.
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 didn't realise that, so I guess
isabspath(expanduser("~")) == true
fails too.
Is there a reason this doesn't work on Windows? (Python's os.path.expanduser
does.)
Any thoughts on this error: https://ci.appveyor.com/project/StefanKarpinski/julia/build/1.0.1596/job/6jqkqtb4eiauvtop |
unfortunate, annoying, unrelated |
@@ -545,6 +545,9 @@ function histrange{T<:Integer,N}(v::AbstractArray{T,N}, n::Integer) | |||
if length(v) == 0 | |||
return 0:1:0 | |||
end | |||
if n <= 0 | |||
throw(DomainError()) |
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 would tend to throw an ArgumentError("number of bins n=$n must be positive")
with a descriptive message. We tend to use DomainError
for more "mathy" functions.
I rebased and have a 32 bit failure: https://ci.appveyor.com/project/StefanKarpinski/julia/build/1.0.2463/job/vfttxv7ydlir0ruq. Will squash if that's unrelated. |
See #10045 |
thanks, will squash and remove/add a rogue |
@timholy rebased again - let me know if anything else needs doing! |
This is great, many thanks! |
Add tests for some untested methods
Some easy tests for a few functions which are not tested at all currently. cc #9493
The last commit includes a very minor fix in the behaviour of histrange (to DomainError if n <= 0, rather than DomainError if n < 0 and InexactError if n == 0), I can remove this and make separate PR if this is controversial.