From e613cb70ea74e316be28569dbd4912dfdeebd985 Mon Sep 17 00:00:00 2001 From: friendseeker <66892505+Friendseeker@users.noreply.github.com> Date: Wed, 27 Nov 2024 00:52:57 -0800 Subject: [PATCH] Avoid generation of negative frequency --- main/src/test/scala/TagsTest.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/test/scala/TagsTest.scala b/main/src/test/scala/TagsTest.scala index 270ca646e..e75dd7e18 100644 --- a/main/src/test/scala/TagsTest.scala +++ b/main/src/test/scala/TagsTest.scala @@ -18,7 +18,7 @@ object TagsTest extends Properties("Tags") { def tagMap: Gen[TagMap] = for (ts <- listOf(tagAndFrequency)) yield ts.toMap def tagAndFrequency: Gen[(Tag, Int)] = - for (t <- tag; count <- Arbitrary.arbitrary[Int]) yield (t, count) + for (t <- tag; count <- Gen.choose(0, Int.MaxValue)) yield (t, count) def tag: Gen[Tag] = for (s <- Gen.alphaStr if !s.isEmpty) yield Tag(s) def size: Gen[Size] = for (i <- Arbitrary.arbitrary[Int] if i != Int.MinValue) yield Size(math.abs(i))