detached 2db8ed5

test(client): remove obsolete query reader

commit
2db8ed5d4800d01ae45080cf22ff88298ee04957
author
brice · · 2026-07-17 11:36 UTC
parent
9bbe15f
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +0 -34
M internal/usecase/client/client_test.go +0 -34
@@ -137,40 +137,6 @@ func (r *chunkedBlockingReader) Read(p []byte) (int, error) {
137137
138138 func (r *chunkedBlockingReader) unblock() { close(r.done) }
139139
140-// queryBoundaryReader reports an attempt to read the second chunk before
141-// returning it, allowing a test to prove that a scheme re-query is a real
142-// stdin generation boundary rather than a lossy notification.
143-type queryBoundaryReader struct {
144- first, second []byte
145- secondRead chan struct{}
146- allowSecond, done <-chan struct{}
147- reads int
148-}
149-
150-func (r *queryBoundaryReader) Read(p []byte) (int, error) {
151- switch r.reads {
152- case 0:
153- r.reads++
154- return copy(p, r.first), nil
155- case 1:
156- select {
157- case r.secondRead <- struct{}{}:
158- case <-r.done:
159- return 0, io.EOF
160- }
161- select {
162- case <-r.allowSecond:
163- r.reads++
164- return copy(p, r.second), nil
165- case <-r.done:
166- return 0, io.EOF
167- }
168- default:
169- <-r.done
170- return 0, io.EOF
171- }
172-}
173-
174140 func newHappyTerminal(t *testing.T, out *bytes.Buffer, restoreCount *atomic.Int32, resizeCh chan domain.Size) (*portsmocks.MockTerminal, *blockingReader) {
175141 tm := portsmocks.NewMockTerminal(t)
176142 tm.EXPECT().Size().Return(domain.Size{Cols: 80, Rows: 24}, nil).Once()
@@ -137,40 +137,6 @@ func (r *chunkedBlockingReader) Read(p []byte) (int, error) {
137 137
138 func (r *chunkedBlockingReader) unblock() { close(r.done) }138 func (r *chunkedBlockingReader) unblock() { close(r.done) }
139 139
140-// queryBoundaryReader reports an attempt to read the second chunk before
141-// returning it, allowing a test to prove that a scheme re-query is a real
142-// stdin generation boundary rather than a lossy notification.
143-type queryBoundaryReader struct {
144- first, second []byte
145- secondRead chan struct{}
146- allowSecond, done <-chan struct{}
147- reads int
148-}
149-
150-func (r *queryBoundaryReader) Read(p []byte) (int, error) {
151- switch r.reads {
152- case 0:
153- r.reads++
154- return copy(p, r.first), nil
155- case 1:
156- select {
157- case r.secondRead <- struct{}{}:
158- case <-r.done:
159- return 0, io.EOF
160- }
161- select {
162- case <-r.allowSecond:
163- r.reads++
164- return copy(p, r.second), nil
165- case <-r.done:
166- return 0, io.EOF
167- }
168- default:
169- <-r.done
170- return 0, io.EOF
171- }
172-}
173-
174 func newHappyTerminal(t *testing.T, out *bytes.Buffer, restoreCount *atomic.Int32, resizeCh chan domain.Size) (*portsmocks.MockTerminal, *blockingReader) {140 func newHappyTerminal(t *testing.T, out *bytes.Buffer, restoreCount *atomic.Int32, resizeCh chan domain.Size) (*portsmocks.MockTerminal, *blockingReader) {
175 tm := portsmocks.NewMockTerminal(t)141 tm := portsmocks.NewMockTerminal(t)
176 tm.EXPECT().Size().Return(domain.Size{Cols: 80, Rows: 24}, nil).Once()142 tm.EXPECT().Size().Return(domain.Size{Cols: 80, Rows: 24}, nil).Once()

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 2

Tags 13

↑↓ moveenter openesc close