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

Provide a Replacement for hash "correct Tag" Test #111

Open
3 tasks
stenolog opened this issue Feb 20, 2024 · 1 comment
Open
3 tasks

Provide a Replacement for hash "correct Tag" Test #111

stenolog opened this issue Feb 20, 2024 · 1 comment

Comments

@stenolog
Copy link

stenolog commented Feb 20, 2024

This test:

property(s"${hash.getClass.getSimpleName} should return correct Tag") {
forAll { (string: String, bytes: Array[Byte]) =>
val digest = hash(string)
digest.isInstanceOf[D] shouldBe true
if (digest.isInstanceOf[Digest32]) {
hash.DigestSize shouldBe 32
} else if (digest.isInstanceOf[Digest64]) {
hash.DigestSize shouldBe 64
}
}
}

is not functional within scala 2.

This came up during work on

Reproduce

  • just replace 32/64 hash.DigestSize shouldBe 32 with a wrong value, the test will not fail.
  • or: add breakpoints to lines 64 and 66
  • or: add else { fail("Tag is not Digest32 or Digest64") } to line 67
  • Scala3 support #108 (review) (reproducer in CI)

Tasks

  • disable the non-functioning part
  • find a solution to have the Tag available in runtime
  • provide a new test (for scala 2 and 3)
@stenolog
Copy link
Author

Potential fix: pull-108-2fa4a7e

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

No branches or pull requests

1 participant