@@ -13,15 +13,15 @@ type Animal struct {
1313}
1414
1515func TestMapCreation (t * testing.T ) {
16- m := New [string ]()
16+ m := New [string ](1 )
1717
1818 if m .Count () != 0 {
1919 t .Error ("new map should be empty." )
2020 }
2121}
2222
2323func TestInsert (t * testing.T ) {
24- m := New [Animal ]()
24+ m := New [Animal ](1 )
2525 elephant := Animal {"elephant" }
2626 monkey := Animal {"monkey" }
2727
@@ -34,7 +34,7 @@ func TestInsert(t *testing.T) {
3434}
3535
3636func TestInsertAbsent (t * testing.T ) {
37- m := New [Animal ]()
37+ m := New [Animal ](1 )
3838 elephant := Animal {"elephant" }
3939 monkey := Animal {"monkey" }
4040
@@ -45,7 +45,7 @@ func TestInsertAbsent(t *testing.T) {
4545}
4646
4747func TestGet (t * testing.T ) {
48- m := New [Animal ]()
48+ m := New [Animal ](1 )
4949
5050 // Get a missing element.
5151 val , ok := m .Get ("Money" )
@@ -73,7 +73,7 @@ func TestGet(t *testing.T) {
7373}
7474
7575func TestHas (t * testing.T ) {
76- m := New [Animal ]()
76+ m := New [Animal ](1 )
7777
7878 // Get a missing element.
7979 if m .Has ("Money" ) == true {
@@ -89,7 +89,7 @@ func TestHas(t *testing.T) {
8989}
9090
9191func TestRemove (t * testing.T ) {
92- m := New [Animal ]()
92+ m := New [Animal ](1 )
9393
9494 monkey := Animal {"monkey" }
9595 m .Set ("monkey" , monkey )
@@ -115,7 +115,7 @@ func TestRemove(t *testing.T) {
115115}
116116
117117func TestRemoveCb (t * testing.T ) {
118- m := New [Animal ]()
118+ m := New [Animal ](1 )
119119
120120 monkey := Animal {"monkey" }
121121 m .Set ("monkey" , monkey )
@@ -203,7 +203,7 @@ func TestRemoveCb(t *testing.T) {
203203}
204204
205205func TestPop (t * testing.T ) {
206- m := New [Animal ]()
206+ m := New [Animal ](1 )
207207
208208 monkey := Animal {"monkey" }
209209 m .Set ("monkey" , monkey )
@@ -236,7 +236,7 @@ func TestPop(t *testing.T) {
236236}
237237
238238func TestCount (t * testing.T ) {
239- m := New [Animal ]()
239+ m := New [Animal ](1 )
240240 for i := 0 ; i < 100 ; i ++ {
241241 m .Set (strconv .Itoa (i ), Animal {strconv .Itoa (i )})
242242 }
@@ -247,7 +247,7 @@ func TestCount(t *testing.T) {
247247}
248248
249249func TestIsEmpty (t * testing.T ) {
250- m := New [Animal ]()
250+ m := New [Animal ](1 )
251251
252252 if m .IsEmpty () == false {
253253 t .Error ("new map should be empty" )
@@ -261,7 +261,7 @@ func TestIsEmpty(t *testing.T) {
261261}
262262
263263func TestIterator (t * testing.T ) {
264- m := New [Animal ]()
264+ m := New [Animal ](1 )
265265
266266 // Insert 100 elements.
267267 for i := 0 ; i < 100 ; i ++ {
@@ -285,7 +285,7 @@ func TestIterator(t *testing.T) {
285285}
286286
287287func TestBufferedIterator (t * testing.T ) {
288- m := New [Animal ]()
288+ m := New [Animal ](1 )
289289
290290 // Insert 100 elements.
291291 for i := 0 ; i < 100 ; i ++ {
@@ -309,7 +309,7 @@ func TestBufferedIterator(t *testing.T) {
309309}
310310
311311func TestClear (t * testing.T ) {
312- m := New [Animal ]()
312+ m := New [Animal ](1 )
313313
314314 // Insert 100 elements.
315315 for i := 0 ; i < 100 ; i ++ {
@@ -324,7 +324,7 @@ func TestClear(t *testing.T) {
324324}
325325
326326func TestIterCb (t * testing.T ) {
327- m := New [Animal ]()
327+ m := New [Animal ](1 )
328328
329329 // Insert 100 elements.
330330 for i := 0 ; i < 100 ; i ++ {
@@ -342,7 +342,7 @@ func TestIterCb(t *testing.T) {
342342}
343343
344344func TestItems (t * testing.T ) {
345- m := New [Animal ]()
345+ m := New [Animal ](1 )
346346
347347 // Insert 100 elements.
348348 for i := 0 ; i < 100 ; i ++ {
@@ -357,7 +357,7 @@ func TestItems(t *testing.T) {
357357}
358358
359359func TestConcurrent (t * testing.T ) {
360- m := New [int ]()
360+ m := New [int ](1 )
361361 ch := make (chan int )
362362 const iterations = 1000
363363 var a [iterations ]int
@@ -421,7 +421,7 @@ func TestJsonMarshal(t *testing.T) {
421421 SHARD_COUNT = 32
422422 }()
423423 expected := "{\" a\" :1,\" b\" :2}"
424- m := New [int ]()
424+ m := New [int ](1 )
425425 m .Set ("a" , 1 )
426426 m .Set ("b" , 2 )
427427 j , err := json .Marshal (m )
@@ -436,7 +436,7 @@ func TestJsonMarshal(t *testing.T) {
436436}
437437
438438func TestKeys (t * testing.T ) {
439- m := New [Animal ]()
439+ m := New [Animal ](1 )
440440
441441 // Insert 100 elements.
442442 for i := 0 ; i < 100 ; i ++ {
@@ -454,7 +454,7 @@ func TestMInsert(t *testing.T) {
454454 "elephant" : {"elephant" },
455455 "monkey" : {"monkey" },
456456 }
457- m := New [Animal ]()
457+ m := New [Animal ](1 )
458458 m .MSet (animals )
459459
460460 if m .Count () != 2 {
@@ -487,7 +487,7 @@ func TestUpsert(t *testing.T) {
487487 return valueInMap
488488 }
489489
490- m := New [Animal ]()
490+ m := New [Animal ](1 )
491491 m .Set ("marine" , dolphin )
492492 m .Upsert ("marine" , whale , cb )
493493 m .Upsert ("predator" , tiger , cb )
@@ -509,7 +509,7 @@ func TestUpsert(t *testing.T) {
509509}
510510
511511func TestKeysWhenRemoving (t * testing.T ) {
512- m := New [Animal ]()
512+ m := New [Animal ](1 )
513513
514514 // Insert 100 elements.
515515 Total := 100
@@ -533,7 +533,7 @@ func TestKeysWhenRemoving(t *testing.T) {
533533}
534534
535535func TestUnDrainedIter (t * testing.T ) {
536- m := New [Animal ]()
536+ m := New [Animal ](1 )
537537 // Insert 100 elements.
538538 Total := 100
539539 for i := 0 ; i < Total ; i ++ {
@@ -585,7 +585,7 @@ func TestUnDrainedIter(t *testing.T) {
585585}
586586
587587func TestUnDrainedIterBuffered (t * testing.T ) {
588- m := New [Animal ]()
588+ m := New [Animal ](1 )
589589 // Insert 100 elements.
590590 Total := 100
591591 for i := 0 ; i < Total ; i ++ {
0 commit comments