Add a test for the CSV parser and check errors on the read config

This commit is contained in:
Miguel de la Cruz 2023-06-30 09:51:34 +02:00
parent ea6ba550b1
commit e9c615197a
2 changed files with 29 additions and 6 deletions

View file

@ -15,8 +15,9 @@ func TestReadConfig(t *testing.T) {
require.NoError(t, err)
defer os.Remove(f.Name())
io.WriteString(f, "---\nbirthday_file: birthday.csv")
f.Close()
_, werr := io.WriteString(f, "---\nbirthday_file: birthday.csv")
require.NoError(t, werr)
require.NoError(t, f.Close())
config, err := ReadConfig(f.Name())
require.NoError(t, err)