@@ -113,9 +113,7 @@ func TestGetProtectionTimestamps(t *testing.T) {
113
113
func (t * testing.T , m * manualStore , subscriber * KVSubscriber ) {
114
114
protections , _ , err := subscriber .GetProtectionTimestamps (ctx , sp42 )
115
115
require .NoError (t , err )
116
- slices .IsSortedFunc (protections , func (a , b hlc.Timestamp ) int {
117
- return a .Compare (b )
118
- })
116
+ require .True (t , slices .IsSortedFunc (protections , hlc .Timestamp .Compare ))
119
117
require .Equal (t , []hlc.Timestamp {ts1 , ts2 }, protections )
120
118
},
121
119
},
@@ -124,9 +122,7 @@ func TestGetProtectionTimestamps(t *testing.T) {
124
122
func (t * testing.T , m * manualStore , subscriber * KVSubscriber ) {
125
123
protections , _ , err := subscriber .GetProtectionTimestamps (ctx , sp43 )
126
124
require .NoError (t , err )
127
- slices .IsSortedFunc (protections , func (a , b hlc.Timestamp ) int {
128
- return a .Compare (b )
129
- })
125
+ require .True (t , slices .IsSortedFunc (protections , hlc .Timestamp .Compare ))
130
126
require .Equal (t , []hlc.Timestamp {ts4 }, protections )
131
127
},
132
128
},
@@ -135,9 +131,7 @@ func TestGetProtectionTimestamps(t *testing.T) {
135
131
func (t * testing.T , m * manualStore , subscriber * KVSubscriber ) {
136
132
protections , _ , err := subscriber .GetProtectionTimestamps (ctx , sp4243 )
137
133
require .NoError (t , err )
138
- slices .IsSortedFunc (protections , func (a , b hlc.Timestamp ) int {
139
- return a .Compare (b )
140
- })
134
+ require .True (t , slices .IsSortedFunc (protections , hlc .Timestamp .Compare ))
141
135
require .Equal (t , []hlc.Timestamp {ts1 , ts2 , ts4 }, protections )
142
136
},
143
137
},
@@ -146,9 +140,7 @@ func TestGetProtectionTimestamps(t *testing.T) {
146
140
func (t * testing.T , m * manualStore , subscriber * KVSubscriber ) {
147
141
protections , _ , err := subscriber .GetProtectionTimestamps (ctx , keys .ExcludeFromBackupSpan )
148
142
require .NoError (t , err )
149
- slices .IsSortedFunc (protections , func (a , b hlc.Timestamp ) int {
150
- return a .Compare (b )
151
- })
143
+ require .True (t , slices .IsSortedFunc (protections , hlc .Timestamp .Compare ))
152
144
require .Empty (t , protections )
153
145
},
154
146
},
@@ -157,9 +149,7 @@ func TestGetProtectionTimestamps(t *testing.T) {
157
149
func (t * testing.T , m * manualStore , subscriber * KVSubscriber ) {
158
150
protections , _ , err := subscriber .GetProtectionTimestamps (ctx , keys .NodeLivenessSpan )
159
151
require .NoError (t , err )
160
- slices .IsSortedFunc (protections , func (a , b hlc.Timestamp ) int {
161
- return a .Compare (b )
162
- })
152
+ require .True (t , slices .IsSortedFunc (protections , hlc .Timestamp .Compare ))
163
153
require .Empty (t , protections )
164
154
},
165
155
},
@@ -171,9 +161,7 @@ func TestGetProtectionTimestamps(t *testing.T) {
171
161
roachpb.Span {Key : keys .MinKey , EndKey : sp43 .EndKey },
172
162
)
173
163
require .NoError (t , err )
174
- slices .IsSortedFunc (protections , func (a , b hlc.Timestamp ) int {
175
- return a .Compare (b )
176
- })
164
+ require .True (t , slices .IsSortedFunc (protections , hlc .Timestamp .Compare ))
177
165
require .Equal (t , []hlc.Timestamp {ts1 , ts2 , ts4 }, protections )
178
166
},
179
167
},
0 commit comments