Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config_test: Add the case of LoadConfigWithInvalidToml #811

Merged
merged 6 commits into from Sep 7, 2022

Conversation

wafuwafu13
Copy link
Contributor

Testing for errors that occur here.

if _, err := toml.DecodeFile(file, config); err != nil {

if err != nil {
t.Errorf("should not raise error: %v", err)
}
defer os.Remove(tmpFile.Name())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use testing.T.Cleanup instead?

t.Cleanup(func(){
    os.Remove(tmpFile.Name())
})

@lufia lufia merged commit 04bd6d5 into mackerelio:master Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants