@@ -196,7 +196,7 @@ func TestApplyFilter(t *testing.T) {
196
196
check (anyData , anyData , true )
197
197
check (anyData , anyData [:len (anyData )- 1 ], true )
198
198
check (anyData , append (anyData , 1 ), false )
199
- for i := range len ( anyData ) {
199
+ for i := range anyData {
200
200
check (anyData , anyData [:i ], true )
201
201
changed := slices .Concat (anyData [:i ], []byte {anyData [i ] + 1 }, anyData [i + 1 :])
202
202
check (anyData , changed [:i + 1 ], false )
@@ -311,6 +311,7 @@ func TestIntBucketOrder(t *testing.T) {
311
311
}
312
312
return nil
313
313
})
314
+ require .NoError (t , err )
314
315
315
316
require .Equal (t , []string {
316
317
"-115792089237316195423570985008687907853269984665640564039457584007913129639935" ,
@@ -1092,19 +1093,19 @@ func TestDB_SearchObjects(t *testing.T) {
1092
1093
}
1093
1094
heightSorted := []objectcore.SearchResultItem {
1094
1095
// attribute takes 1st order priority
1095
- {ids [9 ], []string {"0" , otherAttrs [0 ]}},
1096
- {ids [8 ], []string {"1" , otherAttrs [1 ]}},
1097
- {ids [7 ], []string {"50" , otherAttrs [2 ]}},
1098
- {ids [6 ], []string {"100" , otherAttrs [3 ]}},
1096
+ {ID : ids [9 ], Attributes : []string {"0" , otherAttrs [0 ]}},
1097
+ {ID : ids [8 ], Attributes : []string {"1" , otherAttrs [1 ]}},
1098
+ {ID : ids [7 ], Attributes : []string {"50" , otherAttrs [2 ]}},
1099
+ {ID : ids [6 ], Attributes : []string {"100" , otherAttrs [3 ]}},
1099
1100
// but if attribute equals, items are sorted by IDs. Secondary attributes have
1100
1101
// no effect, otherwise the order would not be reversed
1101
- {ids [3 ], []string {"101" , otherAttrs [6 ]}},
1102
- {ids [4 ], []string {"101" , otherAttrs [5 ]}},
1103
- {ids [5 ], []string {"101" , otherAttrs [4 ]}},
1102
+ {ID : ids [3 ], Attributes : []string {"101" , otherAttrs [6 ]}},
1103
+ {ID : ids [4 ], Attributes : []string {"101" , otherAttrs [5 ]}},
1104
+ {ID : ids [5 ], Attributes : []string {"101" , otherAttrs [4 ]}},
1104
1105
// attribute takes power again
1105
- {ids [2 ], []string {"102" , otherAttrs [7 ]}},
1106
- {ids [1 ], []string {"150" , otherAttrs [8 ]}},
1107
- {ids [0 ], []string {"4294967295" , otherAttrs [9 ]}},
1106
+ {ID : ids [2 ], Attributes : []string {"102" , otherAttrs [7 ]}},
1107
+ {ID : ids [1 ], Attributes : []string {"150" , otherAttrs [8 ]}},
1108
+ {ID : ids [0 ], Attributes : []string {"4294967295" , otherAttrs [9 ]}},
1108
1109
}
1109
1110
// store
1110
1111
cnr := cidtest .ID ()
@@ -1164,9 +1165,9 @@ func TestDB_SearchObjects(t *testing.T) {
1164
1165
require .Empty (t , res [i ].Attributes )
1165
1166
}
1166
1167
require .NotEmpty (t , cursor )
1168
+ //nolint:staticcheck // drop with t.Skip
1167
1169
res , cursor , err = db .Search (cnr , fs , nil , cursor , 6 )
1168
1170
require .NoError (t , err )
1169
- // TODO: issue
1170
1171
t .Skip ("paging is broken when prim attribute is not requested, see also https://github.com/nspcc-dev/neofs-node/issues/3058#issuecomment-2553193094" )
1171
1172
require .Len (t , res , 6 )
1172
1173
for i := range 6 {
@@ -1240,6 +1241,7 @@ func TestDB_SearchObjects(t *testing.T) {
1240
1241
require .Empty (t , res [i ].Attributes )
1241
1242
}
1242
1243
require .NotEmpty (t , cursor )
1244
+ //nolint:staticcheck // drop with t.Skip
1243
1245
res , cursor , err = db .Search (cnr , fs , nil , cursor , 6 )
1244
1246
require .NoError (t , err )
1245
1247
t .Skip ("paging is broken when prim attribute is not requested, see also https://github.com/nspcc-dev/neofs-node/issues/3058#issuecomment-2553193094" )
@@ -1331,15 +1333,15 @@ func TestDB_SearchObjects(t *testing.T) {
1331
1333
require .NoError (t , err )
1332
1334
require .Empty (t , cursor )
1333
1335
require .Equal (t , []objectcore.SearchResultItem {
1334
- {ids [0 ], []string {"cat1.jpg" , "1738760790" }},
1336
+ {ID : ids [0 ], Attributes : []string {"cat1.jpg" , "1738760790" }},
1335
1337
}, res )
1336
1338
})
1337
1339
t .Run ("multiple" , func (t * testing.T ) {
1338
1340
t .Run ("both attributes" , func (t * testing.T ) {
1339
1341
fullRes := []objectcore.SearchResultItem {
1340
- {ids [1 ], []string {"cat2.jpg" , "1738760792" }},
1341
- {ids [2 ], []string {"cat2.jpg" , "1738760791" }},
1342
- {ids [3 ], []string {"cat2.jpg" , "1738760793" }},
1342
+ {ID : ids [1 ], Attributes : []string {"cat2.jpg" , "1738760792" }},
1343
+ {ID : ids [2 ], Attributes : []string {"cat2.jpg" , "1738760791" }},
1344
+ {ID : ids [3 ], Attributes : []string {"cat2.jpg" , "1738760793" }},
1343
1345
}
1344
1346
var fs object.SearchFilters
1345
1347
fs .AddFilter (object .AttributeFilePath , "cat2.jpg" , object .MatchStringEqual )
0 commit comments