@@ -122,7 +122,7 @@ func TestFetchAndSetScope(t *testing.T) {
122
122
}
123
123
err := ts .FetchAndSetScope (ctx , keys , db )
124
124
require .NoError (err , "Error thrown." )
125
- require .Equal (0 , ts .OpIndex (), "Opertions not updated correctly." )
125
+ require .Equal (0 , ts .OpIndex (), "Operations not updated correctly." )
126
126
require .Equal (keys , ts .scope , "Scope not updated correctly." )
127
127
// Check values
128
128
for i , key := range keys {
@@ -146,7 +146,7 @@ func TestFetchAndSetScopeMissingKey(t *testing.T) {
146
146
}
147
147
err := ts .FetchAndSetScope (ctx , keys , db )
148
148
require .NoError (err , "Error thrown." )
149
- require .Equal (0 , ts .OpIndex (), "Opertions not updated correctly." )
149
+ require .Equal (0 , ts .OpIndex (), "Operations not updated correctly." )
150
150
require .Equal (keys , ts .scope , "Scope not updated correctly." )
151
151
// Check values
152
152
for i , key := range keys [:len (keys )- 1 ] {
@@ -178,20 +178,20 @@ func TestRemoveInsertRollback(t *testing.T) {
178
178
v , err := ts .GetValue (ctx , TestKey )
179
179
require .NoError (err )
180
180
require .Equal (TestVal , v )
181
- require .Equal (1 , ts .OpIndex (), "Opertions not updated correctly." )
181
+ require .Equal (1 , ts .OpIndex (), "Operations not updated correctly." )
182
182
// Remove
183
183
err = ts .Remove (ctx , TestKey )
184
184
require .NoError (err , "Error from remove." )
185
185
_ , err = ts .GetValue (ctx , TestKey )
186
186
require .ErrorIs (err , database .ErrNotFound , "Key not deleted from storage." )
187
- require .Equal (2 , ts .OpIndex (), "Opertions not updated correctly." )
187
+ require .Equal (2 , ts .OpIndex (), "Operations not updated correctly." )
188
188
// Insert
189
189
err = ts .Insert (ctx , TestKey , TestVal )
190
190
require .NoError (err , "Error from insert." )
191
191
v , err = ts .GetValue (ctx , TestKey )
192
192
require .NoError (err )
193
193
require .Equal (TestVal , v )
194
- require .Equal (3 , ts .OpIndex (), "Opertions not updated correctly." )
194
+ require .Equal (3 , ts .OpIndex (), "Operations not updated correctly." )
195
195
require .Equal (1 , ts .PendingChanges ())
196
196
// Rollback
197
197
ts .Rollback (ctx , 2 )
@@ -327,7 +327,7 @@ func TestWriteChanges(t *testing.T) {
327
327
}
328
328
329
329
func BenchmarkFetchAndSetScope (b * testing.B ) {
330
- for _ , size := range []int {10 , 100 , 1000 } {
330
+ for _ , size := range []int {4 , 8 , 16 , 32 , 64 , 128 } {
331
331
b .Run (fmt .Sprintf ("fetch_and_set_scope_%d_keys" , size ), func (b * testing.B ) {
332
332
benchmarkFetchAndSetScope (b , size )
333
333
})
0 commit comments