Skip to content

Commit

Permalink
test: fix the action test fail
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Apr 15, 2022
1 parent d9f66ad commit 086e622
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions load_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ func TestLoad(t *testing.T) {
is := assert.New(t)

var name string
c := New("test").WithOptions(WithHookFunc(func(event string, c *Config) {
name = event
}))
c := New("test").
WithOptions(WithHookFunc(func(event string, c *Config) {
name = event
}))
err := c.LoadExists("testdata/json_base.json", "not-exist.json")
is.Nil(err)
is.Equal(OnLoadData, name)

c.ClearAll()
is.Equal(OnCleanData, name)

// load map data
err = c.LoadData(map[string]interface{}{
Expand All @@ -63,6 +64,7 @@ func TestLoad(t *testing.T) {
"info": map[string]string{"k1": "a", "k2": "b"},
})

is.Equal(OnLoadData, name)
is.NotEmpty(c.Data())
is.Nil(err)

Expand Down

0 comments on commit 086e622

Please sign in to comment.