Debian Codegraph @

id_test.go

raw symbols ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 package machineid
2
3 import "testing"
4
5 func TestID(t *testing.T) {
6 got, err := ID()
7 if err != nil {
8 t.Error(err)
9 }
10 if got == "" {
11 t.Error("Got empty machine id")
12 }
13 }
14
15 func TestProtectedID(t *testing.T) {
16 id, err := ID()
17 if err != nil {
18 t.Error(err)
19 }
20 hash, err := ProtectedID("app.id")
21 if err != nil {
22 t.Error(err)
23 }
24 if hash == "" {
25 t.Error("Got empty machine id hash")
26 }
27 if id == hash {
28 t.Error("id and hashed id are the same")
29 }
30 }