Skip to content

Commit ca17158

Browse files
authored
Fix TestNewConfigWithWrongConfigPath for windows (iotexproject#1343)
1 parent 7bae8d3 commit ca17158

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

config/config_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ func TestNewConfigWithWrongConfigPath(t *testing.T) {
4040
cfg, err := New()
4141
require.NotNil(t, err)
4242
require.Equal(t, Config{}, cfg)
43-
require.Contains(t, err.Error(), "open wrong_path: no such file or directory")
43+
if strings.Contains(err.Error(),
44+
"open wrong_path: The system cannot find the file specified") == false { // for Windows
45+
require.Contains(t, err.Error(), "open wrong_path: no such file or directory")
46+
}
4447
}
4548

4649
func TestNewConfigWithOverride(t *testing.T) {

0 commit comments

Comments
 (0)