You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DateKeys/profile/status_test.go

22 lines
562 B

package profile
import "testing"
func TestStatus(t *testing.T) {
h, err := Quicknet().Hash()
if err != nil {
t.Fatal(err)
}
if s, ok := StatusOf(h); !ok || s != Active {
t.Errorf("StatusOf(Quicknet) = %v, %v", s, ok)
}
if s, ok := StatusOf([32]byte{1}); ok || s != Active {
t.Errorf("StatusOf of an unknown profile = %v, %v", s, ok)
}
for s, want := range map[Status]string{Active: "active", ReadOnly: "read-only", Compromised: "compromised", 7: "unknown"} {
if s.String() != want {
t.Errorf("%d: %q, want %q", s, s.String(), want)
}
}
}

Powered by TurnKey Linux.