Merge pull request #11839 from priyansh786/develop

Don't create empty expectation files when updating test expectations
This commit is contained in:
Kamil Śliwak 2021-08-31 16:46:14 +02:00 committed by GitHub
commit 5e5f49df93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,6 +71,15 @@ function update_expectation {
local newExpectation="${1}"
local expectationFile="${2}"
if [[ $newExpectation == "" || $newExpectation -eq 0 && $expectationFile == */exit ]]
then
if [[ -f $expectationFile ]]
then
rm "$expectationFile"
fi
return
fi
echo "$newExpectation" > "$expectationFile"
printLog "File $expectationFile updated to match the expectation."
}