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

New deprecation warning #195

Closed
robdockins opened this issue Mar 28, 2022 · 3 comments · Fixed by #198
Closed

New deprecation warning #195

robdockins opened this issue Mar 28, 2022 · 3 comments · Fixed by #198

Comments

@robdockins
Copy link
Contributor

I don't remember seeing this one before. I'm not sure what the correct mitigation is yet.

test/ExprBuilderSMTLib2.hs:1115:3: warning: [-Wdeprecations]
    In the use of ‘testProperty’ (imported from Test.Tasty.Hedgehog):
    Deprecated: "testProperty will cause Hedgehog to provide incorrect instructions for re-checking properties"
     |
1115 |   testProperty ("test resolveSymBV (" ++ show (PP.pretty searchStrat) ++ ")") $
     |   ^^^^^^^^^^^^

@RyanGlScott
Copy link
Contributor

This is a new warning introduced in tasty-hedgehog-1.2.0.0. See qfpl/tasty-hedgehog#42. Unfortunately, this affects pretty much every test suite we have that uses tasty-hedgehog.

@RyanGlScott
Copy link
Contributor

If we decide it's not worth it to migrate every use of testProperty to testPropertyName, we could just punt and define our own version of testProperty without the deprecation warning. Something like this, perhaps:

import qualified Data.String

testProperty' :: TestName -> Property -> TestTree
testProperty' name = testPropertyNamed name (Data.String.fromString name)

RyanGlScott added a commit that referenced this issue Apr 12, 2022
This fixes #195—or, at the very least, makes the deprecation warnings that
arise from `tasty-hedgehog`'s version of `testProperty` go away. The "real"
fix would be to convert every use of `testProperty` into a top-level `Property`
value, but given how tedious that would be, I'm disinclined to do this unless
someone specifically requests it.
@RyanGlScott
Copy link
Contributor

As an experiment, I decided how awful it would be to convert all hedgehog properties in parameterized-utils to top-level values so that they could be used with testPropertyNamed. See GaloisInc/parameterized-utils#131 for the results. Unsurprisingly, this was an extremely tedious process. Mechanical, but tedious.

what4 has even more properties than parameterized-utils, so I ultimately ran out of energy to apply the same treatment to what4. I've compromised by defining our own, warning-free version of testProperty in #198 and using that everywhere.

RyanGlScott added a commit that referenced this issue Apr 14, 2022
This fixes #195—or, at the very least, makes the deprecation warnings that
arise from `tasty-hedgehog`'s version of `testProperty` go away. The "real"
fix would be to convert every use of `testProperty` into a top-level `Property`
value, but given how tedious that would be, I'm disinclined to do this unless
someone specifically requests it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants