Skip to content

Commit

Permalink
update test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Ting committed Jun 5, 2024
1 parent c60503c commit 3c921bb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions core/econf/conf_api_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package econf

import (
"fmt"
"io/ioutil"
"log"
"net/url"
Expand Down Expand Up @@ -115,12 +114,13 @@ func newWithConfigFile(t *testing.T) (*Configuration, string, func(), *sync.Wait
require.Nil(t, err)
content, err := os.ReadFile(configFile)
if err != nil {
t.Logf("Content of configFile: %v\n", string(content))
log.Panicf("Error: %v\n", err)
}
fmt.Println("Content of configFile:", string(content))
t.Logf("Content of configFile: %v\n", string(content))

cleanup := func() {
_ = os.RemoveAll(watchDir)
err1 := os.RemoveAll(watchDir)
assert.NoError(t, err1)
}

v := New()
Expand Down Expand Up @@ -155,7 +155,8 @@ func newWithSymlinkedConfigFile(t *testing.T) (*Configuration, string, string, f
err = os.WriteFile(realConfigFile, []byte(`foo= "baz"`), 0640)
require.Nil(t, err)
cleanup := func() {
_ = os.RemoveAll(watchDir)
err1 := os.RemoveAll(watchDir)
assert.NoError(t, err1)
}
// now, symlink the tm `data1` dir to `data` in the baseDir
err = os.Symlink(dataDir1, path.Join(watchDir, "data"))
Expand Down

0 comments on commit 3c921bb

Please sign in to comment.