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

Make tests run in a few seconds #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alexfmpe
Copy link

@alexfmpe alexfmpe commented Dec 20, 2023

Running 1 test suites...
Test suite tests: RUNNING...
Tests
  KATs
    argon2 README
      hashEncoded:      OK (0.07s)
      verifyEncoded:    OK (0.07s)
      verifyEncoded 2:  OK (0.07s)
      verifyEncoded 3:  OK (0.07s)
      verifyEncoded 4:  OK (0.07s)
      verifyEncoded 5:  OK
      verifyEncoded 6:  OK
      verifyEncoded 7:  OK
      hash:             OK (0.07s)
  Properties
    Round trip:         OK (5.86s)
      +++ OK, passed 100 tests.
    Unencoded hashing:  OK (2.86s)
      +++ OK, passed 100 tests.
    defaultHashOptions: OK (1.28s)
      +++ OK, passed 100 tests.

All 12 tests passed (10.42s)
Test suite tests: PASS

src-tests/Tests.hs Outdated Show resolved Hide resolved
<*> arbitraryWithin (FFI.ARGON2_MIN_MEMORY*p) (FFI.ARGON2_MIN_MEMORY*p*4) -- arbitraryWithin (max (max FFI.ARGON2_MIN_MEMORY (8 * p)) (shiftL p 3)) (min FFI.ARGON2_MAX_MEMORY 512)
<*> pure p
<*> arbitraryVariant
<*> arbitraryVersion
<*> arbitraryWithin FFI.ARGON2_MIN_OUTLEN (min FFI.ARGON2_MAX_OUTLEN 65536)

arbitraryWithin lower upper = arbitrary `suchThat` (inRange (lower,upper))
Copy link
Author

Choose a reason for hiding this comment

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

I'm not sure how the properties testing ever worked with this generator.
p <- arbitraryWithin 1 4 would blindly generate Word32 until it a number between 1 and 4 was returned, essentially preventing progress on the suite.

@alexfmpe alexfmpe changed the title Make tests run in a few minutes Make tests run in a few seconds Jun 24, 2024
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.

1 participant