detached 83d1d24

fix(test): replace InEpsilon with InDelta in split tests

commit
83d1d246725b50afd7a49de1f8eadbaa6766889b
author
brice · · 2025-12-22 06:41 UTC
parent
0f157de
signature
unsigned
1 file · +5 -5
M internal/ui/layout/split_test.go +5 -5
@@ -55,7 +55,7 @@ func TestNewSplitView_Horizontal(t *testing.T) {
5555 // Assert
5656 require.NotNil(t, sv)
5757 assert.Equal(t, layout.OrientationHorizontal, sv.Orientation())
58- assert.InEpsilon(t, 0.5, sv.GetRatio(), 0.0001)
58+ assert.InDelta(t, 0.5, sv.GetRatio(), 0.0001)
5959 assert.Equal(t, mockStartChild, sv.StartChild())
6060 assert.Equal(t, mockEndChild, sv.EndChild())
6161 }
@@ -81,7 +81,7 @@ func TestNewSplitView_Vertical(t *testing.T) {
8181 // Assert
8282 require.NotNil(t, sv)
8383 assert.Equal(t, layout.OrientationVertical, sv.Orientation())
84- assert.InEpsilon(t, 0.5, sv.GetRatio(), 0.0001)
84+ assert.InDelta(t, 0.5, sv.GetRatio(), 0.0001)
8585 assert.Equal(t, mockStartChild, sv.StartChild())
8686 assert.Equal(t, mockEndChild, sv.EndChild())
8787 }
@@ -134,7 +134,7 @@ func TestSetRatio_ValidRange(t *testing.T) {
134134 sv.SetRatio(tt.input)
135135
136136 // Assert
137- assert.InEpsilon(t, tt.expected, sv.GetRatio(), 0.0001)
137+ assert.InDelta(t, tt.expected, sv.GetRatio(), 0.0001)
138138 })
139139 }
140140 }
@@ -167,7 +167,7 @@ func TestSetRatio_OutOfRange_Clamped(t *testing.T) {
167167 sv.SetRatio(tt.input)
168168
169169 // Assert
170- assert.InEpsilon(t, tt.expected, sv.GetRatio(), 0.0001)
170+ assert.InDelta(t, tt.expected, sv.GetRatio(), 0.0001)
171171 })
172172 }
173173 }
@@ -371,7 +371,7 @@ func TestNewSplitView_InitialRatio_Clamped(t *testing.T) {
371371 sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, nil, tt.input)
372372
373373 // Assert
374- assert.InEpsilon(t, tt.expected, sv.GetRatio(), 0.0001)
374+ assert.InDelta(t, tt.expected, sv.GetRatio(), 0.0001)
375375 })
376376 }
377377 }
@@ -55,7 +55,7 @@ func TestNewSplitView_Horizontal(t *testing.T) {
55 // Assert55 // Assert
56 require.NotNil(t, sv)56 require.NotNil(t, sv)
57 assert.Equal(t, layout.OrientationHorizontal, sv.Orientation())57 assert.Equal(t, layout.OrientationHorizontal, sv.Orientation())
58- assert.InEpsilon(t, 0.5, sv.GetRatio(), 0.0001)58+ assert.InDelta(t, 0.5, sv.GetRatio(), 0.0001)
59 assert.Equal(t, mockStartChild, sv.StartChild())59 assert.Equal(t, mockStartChild, sv.StartChild())
60 assert.Equal(t, mockEndChild, sv.EndChild())60 assert.Equal(t, mockEndChild, sv.EndChild())
61 }61 }
@@ -81,7 +81,7 @@ func TestNewSplitView_Vertical(t *testing.T) {
81 // Assert81 // Assert
82 require.NotNil(t, sv)82 require.NotNil(t, sv)
83 assert.Equal(t, layout.OrientationVertical, sv.Orientation())83 assert.Equal(t, layout.OrientationVertical, sv.Orientation())
84- assert.InEpsilon(t, 0.5, sv.GetRatio(), 0.0001)84+ assert.InDelta(t, 0.5, sv.GetRatio(), 0.0001)
85 assert.Equal(t, mockStartChild, sv.StartChild())85 assert.Equal(t, mockStartChild, sv.StartChild())
86 assert.Equal(t, mockEndChild, sv.EndChild())86 assert.Equal(t, mockEndChild, sv.EndChild())
87 }87 }
@@ -134,7 +134,7 @@ func TestSetRatio_ValidRange(t *testing.T) {
134 sv.SetRatio(tt.input)134 sv.SetRatio(tt.input)
135 135
136 // Assert136 // Assert
137- assert.InEpsilon(t, tt.expected, sv.GetRatio(), 0.0001)137+ assert.InDelta(t, tt.expected, sv.GetRatio(), 0.0001)
138 })138 })
139 }139 }
140 }140 }
@@ -167,7 +167,7 @@ func TestSetRatio_OutOfRange_Clamped(t *testing.T) {
167 sv.SetRatio(tt.input)167 sv.SetRatio(tt.input)
168 168
169 // Assert169 // Assert
170- assert.InEpsilon(t, tt.expected, sv.GetRatio(), 0.0001)170+ assert.InDelta(t, tt.expected, sv.GetRatio(), 0.0001)
171 })171 })
172 }172 }
173 }173 }
@@ -371,7 +371,7 @@ func TestNewSplitView_InitialRatio_Clamped(t *testing.T) {
371 sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, nil, tt.input)371 sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, nil, tt.input)
372 372
373 // Assert373 // Assert
374- assert.InEpsilon(t, tt.expected, sv.GetRatio(), 0.0001)374+ assert.InDelta(t, tt.expected, sv.GetRatio(), 0.0001)
375 })375 })
376 }376 }
377 }377 }

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 8

Tags 42

↑↓ moveenter openesc close