From 0cd34287ddeeaf8ec9f88d983cceae0acef7cfed Mon Sep 17 00:00:00 2001 From: Christopher Meis Date: Tue, 30 Jan 2024 15:42:56 +0100 Subject: [PATCH] Fix Test in bruteforcer so it works with go > 1.20 Signed-off-by: Christopher Meis --- pkg/bruteforcer/indexes_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/bruteforcer/indexes_test.go b/pkg/bruteforcer/indexes_test.go index 9543ebc4..2541e73f 100644 --- a/pkg/bruteforcer/indexes_test.go +++ b/pkg/bruteforcer/indexes_test.go @@ -20,11 +20,11 @@ func TestGetCombinationID(t *testing.T) { } func TestSetGetCombinationID(t *testing.T) { - rand.Seed(0) + r := rand.New(rand.NewSource(0)) iter := NewUniqueUnorderedCombinationIterator(10, 70) amountOfCombinations := uint64(binomialCoefficient(70, 10)) for i := 0; i < 100; i++ { - combinationID := rand.Uint64() % amountOfCombinations + combinationID := r.Uint64() % amountOfCombinations iter.SetCombinationID(combinationID) require.Equal(t, combinationID, iter.GetCombinationID()) iter.Next()