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

Add coverage tests for strings/basic.jl #12898

Merged
merged 1 commit into from
Sep 1, 2015

Conversation

ScottPJones
Copy link
Contributor

These tests should hopefully bring the coverage of strings/basic.jl to 100%

@kshyatt kshyatt added the test This change adds or pertains to unit tests label Sep 1, 2015
# This gets a deprecation warning that seems incorrect
# getindex("a",1.0) -> WARNING: indexing with non Integer Reals is deprecated
# Capture spurious deprecation warning
let
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't belong here. You should be testing current behavior, not the behavior that you may want.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean the comment? It is testing current behavior already.

Copy link
Member

Choose a reason for hiding this comment

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

You are testing depwarn behavior, just test the behavior that is implemented in Base.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The behavior is implemented in Base. It showed up on the coverage tests.
Look at line 39 in strings/basic.jl:

getindex(s::AbstractString, x::Real) = s[to_index(x)]

Copy link
Member

Choose a reason for hiding this comment

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

I am not going to debate this, please remove the contents of this let block and I'll merge.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should the getindex call itself be moved to deprecated.jl then, since it depends on a deprecated method (to_index(x::Real))?
I was just trying to make sure that every line in strings was covered.

Remove testing of getindex/checkbounds
@ScottPJones
Copy link
Contributor Author

@jakebolewski I've removed them (I'm going to do another PR to remove the code that depended on deprecated code, here and in char.jl)

@jakebolewski
Copy link
Member

Thanks!

jakebolewski added a commit that referenced this pull request Sep 1, 2015
Add coverage tests for strings/basic.jl
@jakebolewski jakebolewski merged commit d58493b into JuliaLang:master Sep 1, 2015
@ScottPJones ScottPJones deleted the spj/testbasic branch September 1, 2015 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test This change adds or pertains to unit tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants