-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/go: it would be great if testScript.cmdExists could check for empty files #54318
Comments
Perhaps instead of |
Yea, maybe, or I could write my own
|
Would you like to send a patch for this? |
@thanm I may when I find time, but my first attempt running the tests inside |
I agree with @ianlancetaylor: you can use |
That would mean doing this for every file:
Well, it's not called This is not a big deal for me, but I would suggest a lower barrier for proposals for non-breaking changes in internal test APIs. If, by adding these 2 lines, you discover a fatal bug in |
What I mean is that the default shouldn't change to check for non-empty files. The "readonly" check is opt-in via a flag, for example. Maybe |
I've been taking some steps to properly extract the With that approach, you could modify your own script's At any rate, I don't think we should make this change in |
See
go/src/cmd/go/script_test.go
Line 816 in 0c4db1e
I'm using this via https://github.com/rogpeppe/go-internal/tree/master/testscript
And I do understand that one reason why you're having this in an internal package is that you don't want bug reports about it, but:
testscript
package is incredibly useful.-zerosize
for the test cases where the file should be empty./cc @rogpeppe
The text was updated successfully, but these errors were encountered: