Skip to content

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

@stenolog

Description

@stenolog

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions