From f372cc796ca07014bba23ad4c685f30b3a2dac69 Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Thu, 9 Aug 2018 13:24:20 +0300 Subject: [PATCH] randomwalk test fix --- .../scorex/crypto/authds/avltree/batch/BatchAVLProver.scala | 2 +- .../crypto/authds/avltree/batch/AVLBatchSpecification.scala | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/scala/scorex/crypto/authds/avltree/batch/BatchAVLProver.scala b/src/main/scala/scorex/crypto/authds/avltree/batch/BatchAVLProver.scala index 48170282..54ca65bf 100644 --- a/src/main/scala/scorex/crypto/authds/avltree/batch/BatchAVLProver.scala +++ b/src/main/scala/scorex/crypto/authds/avltree/batch/BatchAVLProver.scala @@ -355,7 +355,7 @@ class BatchAVLProver[D <: Digest, HF <: CryptographicHash[D]](val keyLength: Int /** * * @param rand - source of randomness - * @return Random leaf from the tree, that is not positive or negative infinity + * @return Random leaf from the tree that is not positive or negative infinity */ def randomWalk(rand: Random = new Random): Option[(ADKey, ADValue)] = { def internalNodeFn(r: InternalProverNode[D], dummy: Unit.type) = diff --git a/src/test/scala/scorex/crypto/authds/avltree/batch/AVLBatchSpecification.scala b/src/test/scala/scorex/crypto/authds/avltree/batch/AVLBatchSpecification.scala index d489bcdd..dbf87344 100644 --- a/src/test/scala/scorex/crypto/authds/avltree/batch/AVLBatchSpecification.scala +++ b/src/test/scala/scorex/crypto/authds/avltree/batch/AVLBatchSpecification.scala @@ -172,8 +172,8 @@ class AVLBatchSpecification extends PropSpec with GeneratorDrivenPropertyChecks forAll { seed: Long => val e1 = prover.randomWalk(new scala.util.Random(seed)) val e2 = prover.randomWalk(new scala.util.Random(seed)) - e1.get._1 shouldEqual e2.get._1 - e1.get._2 shouldEqual e2.get._2 + e1.map(_._1) shouldEqual e2.map(_._1) + e1.map(_._2) shouldEqual e2.map(_._2) } }