navidrome/utils/random/number_test.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
458 B
Go
Raw Permalink Normal View History

2024-05-11 20:04:21 -04:00
package random_test
import (
"testing"
"github.com/navidrome/navidrome/utils/random"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
func TestRandom(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Random Suite")
}
var _ = Describe("number package", func() {
2024-05-19 21:55:19 -04:00
Describe("Int64N", func() {
2024-05-11 20:04:21 -04:00
It("should return a random int64", func() {
2026-02-08 08:57:30 -06:00
for range 10000 {
2024-05-19 21:55:19 -04:00
Expect(random.Int64N(100)).To(BeNumerically("<", 100))
2024-05-11 20:04:21 -04:00
}
})
})
})