Skip to content

Commit 14d6ce2

Browse files
authored
Merge pull request #110 from aslesarenko/towards-scala3
Fix test of DigestSize
2 parents 30aacd4 + 2b2751a commit 14d6ce2

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

shared/src/test/scala/scorex/crypto/hash/HashTest.scala

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ import org.scalatest.matchers.should.Matchers
66
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
77
import scorex.util.encode.Base16
88

9-
import scala.concurrent.ExecutionContext.Implicits.global
10-
import scala.concurrent.duration._
11-
import scala.concurrent.{Await, Future}
12-
139
trait HashTest extends AnyPropSpec
1410
with ScalaCheckDrivenPropertyChecks
1511
with Matchers {
@@ -56,15 +52,11 @@ trait HashTest extends AnyPropSpec
5652
}
5753

5854

59-
property(s"${hash.getClass.getSimpleName} should return correct Tag") {
60-
forAll { (string: String, bytes: Array[Byte]) =>
61-
val digest = hash(string)
62-
digest.isInstanceOf[D] shouldBe true
63-
if (digest.isInstanceOf[Digest32]) {
64-
hash.DigestSize shouldBe 32
65-
} else if (digest.isInstanceOf[Digest64]) {
66-
hash.DigestSize shouldBe 64
67-
}
55+
property(s"${hash.getClass.getSimpleName} should have correct size") {
56+
if (hash.isInstanceOf[CryptographicHash32]) {
57+
hash.DigestSize shouldBe 32
58+
} else {
59+
hash.DigestSize shouldBe 64
6860
}
6961
}
7062
}

0 commit comments

Comments
 (0)