Skip to content

Commit

Permalink
allow -count to be passed to go test
Browse files Browse the repository at this point in the history
  • Loading branch information
btoews committed Jan 23, 2024
1 parent b0ac63c commit e761a26
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions caveat.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ func RegisterCaveatJSONAlias(typ CaveatType, alias string) {
s2t[alias] = typ
}

func unegisterCaveatJSONAlias(alias string) {
delete(s2t, alias)
}

func typeToCaveat(t CaveatType) Caveat {
cav, ok := t2c[t]
if !ok {
Expand Down
1 change: 1 addition & 0 deletions caveat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func TestCaveatRegistry(t *testing.T) {
assert.Equal(t, c, cs.Caveats[0])

RegisterCaveatJSONAlias(cavTestParentResource, "Foobar")
t.Cleanup(func() { unegisterCaveatJSONAlias("Foobar") })

assert.NoError(t, json.Unmarshal(j1, cs))
assert.Equal(t, 1, len(cs.Caveats))
Expand Down

0 comments on commit e761a26

Please sign in to comment.