quintodrome/utils/random/number_test.go

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

25 lines
458 B
Go
Raw Permalink Normal View History

2024-05-11 16:04:21 -08: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 17:55:19 -08:00
Describe("Int64N", func() {
2024-05-11 16:04:21 -08:00
It("should return a random int64", func() {
2026-02-08 05:57:30 -09:00
for range 10000 {
2024-05-19 17:55:19 -08:00
Expect(random.Int64N(100)).To(BeNumerically("<", 100))
2024-05-11 16:04:21 -08:00
}
})
})
})