Skip to content

Commit

Permalink
some more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sio4 committed Apr 23, 2022
1 parent 38d0ef5 commit 606cfde
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
14 changes: 14 additions & 0 deletions internal/common/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ func TestContextCancel(t *testing.T) {
r.NotNil(c.Err())
}

func TestContextDoubleCancel(t *testing.T) {
r := require.New(t)

opt := Options{LogLevel: "info"}
c, ccf := NewDefaultContext(&opt)
r.NotNil(c)
r.NotNil(ccf)

r.Nil(c.Err())
c.Cancel()
r.NotNil(c.Err())
c.Cancel()
}

func TestContextWG(t *testing.T) {
r := require.New(t)

Expand Down
5 changes: 5 additions & 0 deletions internal/common/plugins_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ func TestBuildPluginOptions(t *testing.T) {
out: nil,
e: fmt.Errorf("%w: heartbeat", ErrInvalidePluginOption),
},
{
in: "",
out: map[string]PluginOptions{},
e: nil,
},
}

for _, tc := range tests {
Expand Down

0 comments on commit 606cfde

Please sign in to comment.