-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testscript: relax constraints around actual source in cmp with update
There are currently constraints on the actual source for a failed cmp comparison when Params.UpdateScripts is true: the actual must be either stdout or stderr. However it's unclear why this constraint is necessary. Indeed it's a painful constraint when the actual source in a comparison is file written by a previous command. Relax this constraint because, after discussion with @mvdan and @rogpeppe, we believe it is safe to do so. Add a test for this new logic where the actual is a file that is part of the archive.
- Loading branch information
Showing
4 changed files
with
26 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
testscript/testdata/testscript_update_script_actual_is_file.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
unquote scripts/testscript.txt | ||
unquote testscript-new.txt | ||
testscript-update scripts | ||
cmp scripts/testscript.txt testscript-new.txt | ||
|
||
-- scripts/testscript.txt -- | ||
>cmp got want | ||
> | ||
>-- got -- | ||
>right | ||
>-- want -- | ||
>wrong | ||
-- testscript-new.txt -- | ||
>cmp got want | ||
> | ||
>-- got -- | ||
>right | ||
>-- want -- | ||
>right |
2 changes: 2 additions & 0 deletions
2
...stscript_update_script_not_in_archive.txt → ...update_script_expected_not_in_archive.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters