Skip to content

testscript: port "mv" and "! cmp" from upstream#168

Merged
mvdan merged 1 commit intorogpeppe:masterfrom
mvdan:153-port
Aug 4, 2022
Merged

testscript: port "mv" and "! cmp" from upstream#168
mvdan merged 1 commit intorogpeppe:masterfrom
mvdan:153-port

Conversation

@mvdan
Copy link
Copy Markdown
Collaborator

@mvdan mvdan commented Jul 24, 2022

(see commit message)

Fixes #153.

@mvdan mvdan requested review from myitcv and rogpeppe July 24, 2022 11:46
Copy link
Copy Markdown
Owner

@rogpeppe rogpeppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks, except that the new functionality needs to be added to the docs.

@mvdan mvdan force-pushed the 153-port branch 2 times, most recently from 16cbd15 to 24c64e7 Compare August 3, 2022 08:50
@mvdan
Copy link
Copy Markdown
Collaborator Author

mvdan commented Aug 3, 2022

PTAL. The way gopls ran 1.19's gofmt, it shifted quite a bit of whitespace in doc.go, which I think we want anyway. To ease your review, ignore whitespace changes: https://github.com/rogpeppe/go-internal/pull/168/files?w=1

Copy link
Copy Markdown
Owner

@rogpeppe rogpeppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo one last trivial thing.

Comment thread testscript/doc.go
They used args[0], which is the first argument to the command,
rather than the command name itself:

	> gofumpt foo.go
	FAIL: [...] use 'exec foo.go' rather than 'foo.go' (because RequireExplicitExec is enabled)

I believe I introduced this regression when refactoring the pull request
due to Roger's review, as I moved the code out of TestMain, where
args[0] was still the name of the command to be run.

Note that I can't easily add a regression test here, because the
testscript command being used in the tests is not a top-level command
run as a separate process, so it does not produce stdout nor stderr.
The change seems easy enough to review manually,
and our tests don't strictly check all error messages anyway.

While here, remove the unnecessary use of -verbose.
Copy link
Copy Markdown
Owner

@rogpeppe rogpeppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

@mvdan mvdan merged commit 77fe68f into rogpeppe:master Aug 4, 2022
@mvdan mvdan deleted the 153-port branch August 22, 2022 08:34
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.

Port 'cmd/go: add mv and support "! cmp" in script tests'

2 participants