Skip to content

Commit

Permalink
fix tsh config test (#11603)
Browse files Browse the repository at this point in the history
check for error when writing to a file
  • Loading branch information
marcoandredinis committed Apr 4, 2022
1 parent ae9e230 commit d1e3a59
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tool/tsh/tshconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ func TestLoadConfigNonExistingFile(t *testing.T) {

func TestLoadConfigEmptyFile(t *testing.T) {
file, err := os.CreateTemp("", "test-telelport")
file.Write([]byte(" "))
require.NoError(t, err)
defer os.Remove(file.Name())

_, err = file.Write([]byte(" "))
require.NoError(t, err)

gotConfig, gotErr := loadConfig(file.Name())
require.NoError(t, gotErr)
require.Equal(t, &TshConfig{}, gotConfig)
Expand Down

0 comments on commit d1e3a59

Please sign in to comment.