File: init_test.go

package info (click to toggle)
golang-github-sean--seed 0.0~git20170313.e2103e2-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 64 kB
  • sloc: makefile: 2
file content (26 lines) | stat: -rw-r--r-- 385 bytes parent folder | download | duplicates (5)
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")
	}
}