-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add proof of concept for T.Output() #1
base: master
Are you sure you want to change the base?
Conversation
src/testing/testing.go
Outdated
return OutputWriter{c} | ||
} | ||
|
||
type OutputWriter struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unexport
src/testing/testing.go
Outdated
parent.mu.Lock() | ||
defer parent.mu.Unlock() | ||
if !parent.done { | ||
parent.output = append(parent.output, parent.decorate(str, depth+1)...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Write
method is at a lower level than logDepth. It isn't responsible for adding line info or a final newline, so it shouldn't call decorate
. It does need to handle indentation, though. I'm not sure where that happens.
f8a90ab
to
61379e3
Compare
Co-authored-by: Aleks Fazlieva <[email protected]>
Co-authored-by: Aleks Fazlieva <[email protected]>
Co-authored-by: Aleks Fazlieva <[email protected]>
Co-authored-by: Aleks Fazlieva <[email protected]>
3fc09b7
to
c949982
Compare
I took another careful look at this. I do think you're on the right track: outputWriter.Write should buffer lines, direct the output to the right place (this test, parent test, etc.) and prepend four spaces. Here is what I think needs to be done:
|
Co-authored-by: Aleks Fazlieva <[email protected]>
Co-authored-by: Aleks Fazlieva <[email protected]>
Co-authored-by: Aleks Fazlieva <[email protected]>
This reverts commit 7b0d211.
Co-authored-by: Aleks Fazlieva <[email protected]>
@jba thank you so much for the guidance. Doing this in two CLs, with the first one being a rewrite of the log/logDepth is a good idea. Since your message, we did the refactor and got tests working. Next steps are going to be cleaning up the code and moving to gerrit. We're aiming to get them done in the next couple of days. |
Sounds good. I'll hold off reviewing until it's on gerrit. |
Co-authored-by: Aleks Fazlieva <[email protected]>
b98c1b4
to
7648014
Compare
d865109
to
820826a
Compare
Co-authored-by: Aleks Fazlieva <[email protected]>
820826a
to
00014da
Compare
Addresses https://go.dev/issue/59928