UnkindPartition / tasty

Modern and extensible testing framework for Haskell
637 stars 108 forks source link

fixed quickcheck percent done error #419

Closed BebeSparkelSparkel closed 1 month ago

BebeSparkelSparkel commented 2 months ago

closes #402

BebeSparkelSparkel commented 2 months ago

@Bodigrim Any thoughts on pulling this fix?

MaximilianAlgehed commented 2 months ago

Probably yes.

Den ons 29 maj 2024 16:41William Rusnack @.***> skrev:

@.**** commented on this pull request.

In quickcheck/Test/Tasty/QuickCheck.hs https://github.com/UnkindPartition/tasty/pull/419#discussion_r1619018183 :

tm <- QC.newTerminal (const $ pure ())

  • (\progressText -> yieldProgress emptyProgress { progressPercent = parseProgress progressText })
  • $ \progressText -> do
  • ms <- readIORef maxSuccess
  • yieldProgress emptyProgress { progressPercent = 100 * parseProgress progressText / ms }

Does the callback remove the need for unsafePerformIO?

— Reply to this email directly, view it on GitHub https://github.com/UnkindPartition/tasty/pull/419#discussion_r1619018183, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACBPPQP4IHXMZ6BMISXPZSLZEXSLBAVCNFSM6AAAAABHHYAJUCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDAOBVGYZTCMZZHA . You are receiving this because you were mentioned.Message ID: @.***>

BebeSparkelSparkel commented 2 months ago

Then it would probably be worth changing

Bodigrim commented 2 months ago

I wonder whether callback would allow to avoid all Terminal shenanigans here. Is it powerful enough?

MaximilianAlgehed commented 2 months ago

Callbacks get both the state and the result so it should be.

Bodigrim commented 1 month ago

@BebeSparkelSparkel do you need any help to make further progress here? I'd like to make a release of tasty and stuff in upcoming weeks.

BebeSparkelSparkel commented 1 month ago

Yes, I do not know how to test this besides the visual I added.

Also, with callbacks should shrinks be reported in the progress?

Bodigrim commented 1 month ago

@BebeSparkelSparkel looks good to me modulo two suggestions above.

BebeSparkelSparkel commented 1 month ago

Done pull

Bodigrim commented 1 month ago

Thanks, that's great.