Skip to content

Commit 5e5f49d

Browse files
authored
Merge pull request #11839 from priyansh786/develop
Don't create empty expectation files when updating test expectations
2 parents 3780e5a + 803901f commit 5e5f49d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/cmdlineTests.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@ function update_expectation {
7171
local newExpectation="${1}"
7272
local expectationFile="${2}"
7373

74+
if [[ $newExpectation == "" || $newExpectation -eq 0 && $expectationFile == */exit ]]
75+
then
76+
if [[ -f $expectationFile ]]
77+
then
78+
rm "$expectationFile"
79+
fi
80+
return
81+
fi
82+
7483
echo "$newExpectation" > "$expectationFile"
7584
printLog "File $expectationFile updated to match the expectation."
7685
}

0 commit comments

Comments
 (0)