Skip to content

Fix some tests and suppress warnings in Julia 0.7 #31

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

Merged
merged 7 commits into from
Jun 13, 2018
Merged

Conversation

tkf
Copy link
Collaborator

@tkf tkf commented Jun 11, 2018

First two commits for make test working. The rest is for suppressing deprecated warnings.

@tkf tkf requested a review from jw3126 June 11, 2018 23:38
@codecov-io
Copy link

codecov-io commented Jun 11, 2018

Codecov Report

Merging #31 into master will increase coverage by 2.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #31      +/-   ##
==========================================
+ Coverage   94.02%   96.09%   +2.06%     
==========================================
  Files           5        4       -1     
  Lines         201      205       +4     
==========================================
+ Hits          189      197       +8     
+ Misses         12        8       -4
Impacted Files Coverage Δ
src/settable.jl 98.38% <100%> (+0.02%) ⬆️
src/sugar.jl 94.44% <0%> (+0.44%) ⬆️
src/macrotools.jl 90.9% <0%> (+6.81%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4d661e8...47bcc7d. Read the comment docs.

@jw3126
Copy link
Owner

jw3126 commented Jun 12, 2018

Thanks for doing this!
Off topic: I am curious what functionality from this package you are actually using. Personally I only use it to manipulate immutable types and never used it to do actual mutations (e.g. v =[1]; @set! v[1]=2). Initially I thought it was useful for generic programming that supports immutable and mutable types simultaneously. But I never needed it in practice. OTOH I implement custom lenses from time to time and then the MutationPolicy machinery just adds annoying complexity. I am thinking about removing it, do you have an opinion about that?

src/settable.jl Outdated
@@ -2,7 +2,12 @@ export @settable
using MacroTools: prewalk, splitdef, combinedef

macro settable(ex)
esc(settable(ex))
M = try
Copy link
Owner

Choose a reason for hiding this comment

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

Is there a reason, why you use try instead of if VERSION < v"0.7-"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was thinking it'd be safer for earlier revisions of Julia master and I was lazy to find at which revision __module__ was introduced. But I used if VERSION < v"0.7-" elsewhere so it's better to stick with it for consistency. I'll fix it.

@@ -22,8 +35,10 @@ end
include("test_kwonly.jl")
end

@static if VERSION < v"0.7-"
Copy link
Owner

Choose a reason for hiding this comment

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

Is the problem QuickTypes not working with 0.7 or is there a problem with our macros, do you know?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

QuickTypes.jl itself doesn't work with the nighly at the moment. I don't know if our macro has any problems. I tried to fix QuickTypes.jl but it's tricky so I thought I'd skip testing for now.

v = randn(3)
@set! v[:] = 1
@test_skip @set! v[:] .= 0
Copy link
Owner

Choose a reason for hiding this comment

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

Why @test_skip and not @test_broken?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@test_broken requires the expression to return false but @set! v[:] .= 0 actually throws at the moment. @test_skip doesn't execute the body so effectively it's commenting out the expression. I thought it's slightly better than commenting out since it shows up in the test result and we can remember that there is something to fix. But @test_skip is not super correct to use it here since @set! v[:] .= 0 will not return true. I suppose I should have leave informative comments there.

@tkf tkf mentioned this pull request Jun 12, 2018
@jw3126 jw3126 merged commit acd19fa into jw3126:master Jun 13, 2018
@tkf tkf mentioned this pull request Jun 13, 2018
@tkf tkf mentioned this pull request Aug 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants