Skip to content

testscript: protect against no-op uses of cmp #295

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

Merged
merged 1 commit into from
Apr 10, 2025
Merged

Conversation

mvdan
Copy link
Collaborator

@mvdan mvdan commented Apr 9, 2025

(see commit message)

@mvdan mvdan requested a review from rogpeppe April 9, 2025 16:35
cueckoo pushed a commit to cue-lang/cue-trybot that referenced this pull request Apr 9, 2025
We were doing `cmp foo.go foo.go` rather than `cmp foo.go foo.go.want`,
which always succeeded, and caused CUE_UPDATE=1 to not update the
"want" files at all.

Fix that, and update the generated files to actually reflect
what we do.

This stumped and annoyed me enough that I also sent a change to
testscript to make such silly mistakes an error:
rogpeppe/go-internal#295

Signed-off-by: Daniel Martí <[email protected]>
Change-Id: If24c6e2439a828c9da7cf3028c61126e899bd96c
Dispatch-Trailer: {"type":"trybot","CL":1213229,"patchset":1,"ref":"refs/changes/29/1213229/1","targetBranch":"master"}
cueckoo pushed a commit to cue-lang/cue-trybot that referenced this pull request Apr 9, 2025
We were doing `cmp foo.go foo.go` rather than `cmp foo.go foo.go.want`,
which always succeeded, and caused CUE_UPDATE=1 to not update the
"want" files at all.

Fix that, and update the generated files to actually reflect
what we do.

This stumped and annoyed me enough that I also sent a change to
testscript to make such silly mistakes an error:
rogpeppe/go-internal#295

Signed-off-by: Daniel Martí <[email protected]>
Change-Id: If24c6e2439a828c9da7cf3028c61126e899bd96c
cueckoo pushed a commit to cue-lang/cue that referenced this pull request Apr 10, 2025
We were doing `cmp foo.go foo.go` rather than `cmp foo.go foo.go.want`,
which always succeeded, and caused CUE_UPDATE=1 to not update the
"want" files at all.

Fix that, and update the generated files to actually reflect
what we do.

This stumped and annoyed me enough that I also sent a change to
testscript to make such silly mistakes an error:
rogpeppe/go-internal#295

Signed-off-by: Daniel Martí <[email protected]>
Change-Id: If24c6e2439a828c9da7cf3028c61126e899bd96c
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1213229
Unity-Result: CUE porcuepine <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
Reviewed-by: Roger Peppe <[email protected]>
This just bit me and it stumped me for a solid five minutes.
I'm sure I've made the mistake at least one more time elsewhere.
@mvdan mvdan merged commit 5223eff into rogpeppe:master Apr 10, 2025
6 checks passed
@mvdan mvdan deleted the cmp-same branch April 10, 2025 11:44
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.

2 participants