-
Notifications
You must be signed in to change notification settings - Fork 2
/
indicator_test.go
47 lines (38 loc) · 1.12 KB
/
indicator_test.go
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright 2023 Contributors to the Veraison project.
// SPDX-License-Identifier: Apache-2.0
package cmw
import (
"testing"
"github.com/stretchr/testify/assert"
)
func Test_Indicator_misc(t *testing.T) {
var i Indicator
assert.True(t, i.Empty())
assert.False(t, i.Has(AttestationResults))
assert.False(t, i.Has(ReferenceValues))
assert.False(t, i.Has(Endorsements))
assert.False(t, i.Has(Evidence))
assert.False(t, i.Has(TrustAnchors))
i.Set(AttestationResults)
assert.True(t, i.Has(AttestationResults))
assert.False(t, i.Has(ReferenceValues))
assert.False(t, i.Has(Endorsements))
assert.False(t, i.Has(Evidence))
assert.False(t, i.Has(TrustAnchors))
i.Clear(AttestationResults)
assert.True(t, i.Empty())
i.Set(AttestationResults)
assert.False(t, i.Empty())
i.Toggle(AttestationResults)
assert.True(t, i.Empty())
i.Set(AttestationResults)
i.Set(ReferenceValues)
i.Set(Evidence)
i.Set(Endorsements)
i.Set(TrustAnchors)
assert.True(t, i.Has(AttestationResults))
assert.True(t, i.Has(ReferenceValues))
assert.True(t, i.Has(Endorsements))
assert.True(t, i.Has(Evidence))
assert.True(t, i.Has(TrustAnchors))
}