From b29dd6dcc4069eb7b1be065615f76917e9f753d4 Mon Sep 17 00:00:00 2001 From: Fabian Kammel Date: Sat, 12 Aug 2023 13:51:17 +0200 Subject: [PATCH] Fix typo. Signed-off-by: Fabian Kammel --- testing/mocks.go | 18 +++++++++--------- verify/trust/trust_test.go | 36 ++++++++++++++++++------------------ 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/testing/mocks.go b/testing/mocks.go index 289543a..7afabb7 100644 --- a/testing/mocks.go +++ b/testing/mocks.go @@ -151,12 +151,12 @@ func (d *Device) Product() *spb.SevProduct { return d.SevProduct } -// GetResponse controls how often (Occurances) a certain response should be +// GetResponse controls how often (Occurrences) a certain response should be // provided. type GetResponse struct { - Occurances uint - Body []byte - Error error + Occurrences uint + Body []byte + Error error } // Getter is a mock for HTTPSGetter interface that sequentially @@ -175,9 +175,9 @@ func SimpleGetter(responses map[string][]byte) *Getter { for key, value := range responses { getter.Responses[key] = []GetResponse{ { - Occurances: ^uint(0), - Body: value, - Error: nil, + Occurrences: ^uint(0), + Body: value, + Error: nil, }, } } @@ -193,8 +193,8 @@ func (g *Getter) Get(url string) ([]byte, error) { } body := resp[0].Body err := resp[0].Error - resp[0].Occurances-- - if resp[0].Occurances == 0 { + resp[0].Occurrences-- + if resp[0].Occurrences == 0 { g.Responses[url] = resp[1:] } return body, err diff --git a/verify/trust/trust_test.go b/verify/trust/trust_test.go index 417cf29..c89fefe 100644 --- a/verify/trust/trust_test.go +++ b/verify/trust/trust_test.go @@ -35,9 +35,9 @@ func TestRetryHTTPSGetter(t *testing.T) { Responses: map[string][]test.GetResponse{ "https://fetch.me": { { - Occurances: 1, - Body: []byte("content"), - Error: nil, + Occurrences: 1, + Body: []byte("content"), + Error: nil, }, }, }, @@ -50,14 +50,14 @@ func TestRetryHTTPSGetter(t *testing.T) { Responses: map[string][]test.GetResponse{ "https://fetch.me": { { - Occurances: 1, - Body: []byte(""), - Error: errors.New("fail"), + Occurrences: 1, + Body: []byte(""), + Error: errors.New("fail"), }, { - Occurances: 1, - Body: []byte("content"), - Error: nil, + Occurrences: 1, + Body: []byte("content"), + Error: nil, }, }, }, @@ -70,14 +70,14 @@ func TestRetryHTTPSGetter(t *testing.T) { Responses: map[string][]test.GetResponse{ "https://fetch.me": { { - Occurances: 2, - Body: []byte(""), - Error: errors.New("fail"), + Occurrences: 2, + Body: []byte(""), + Error: errors.New("fail"), }, { - Occurances: 1, - Body: []byte("content"), - Error: nil, + Occurrences: 1, + Body: []byte("content"), + Error: nil, }, }, }, @@ -112,9 +112,9 @@ func TestRetryHTTPSGetterAllFail(t *testing.T) { Responses: map[string][]test.GetResponse{ "https://fetch.me": { { - Occurances: 1, - Body: []byte(""), - Error: errors.New("fail"), + Occurrences: 1, + Body: []byte(""), + Error: errors.New("fail"), }, }, },