summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/sean-/seed/init_test.go
blob: 4736061f73cc7d709edd453c6d94d92bb6e4f5fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package seed_test

import (
	"testing"

	"github.com/sean-/seed"
)

func TestInit(t *testing.T) {
	secure, err := seed.Init()
	if !secure {
		t.Fatalf("Failed to securely seed: %v", err)
	}
}

func TestMustInit(t *testing.T) {
	seed.MustInit()

	if !seed.Seeded() {
		t.Fatalf("MustInit() failed to seed")
	}

	if !seed.Secure() {
		t.Fatalf("MustInit() failed to securely seed")
	}
}