Migrates many tests to errors_test

This commit is contained in:
2021-05-16 22:00:50 -07:00
parent dd48d610dc
commit e941c90f0d
6 changed files with 188 additions and 85 deletions

View File

@@ -53,6 +53,12 @@ func filterErr(stderr string) error {
if matched, _ := regexp.MatchString(`does not exist`, stderr); matched {
return ErrDoesNotExist
}
if matched, _ := regexp.MatchString(`not found.`, stderr); matched {
return ErrDoesNotExist
}
if matched, _ := regexp.MatchString(`not loaded.`, stderr); matched {
return ErrUnitNotLoaded
}
if matched, _ := regexp.MatchString(`No such file or directory`, stderr); matched {
return ErrDoesNotExist
}