github.com/tursom/GoCollections@v0.3.10/collections/HashMap_test.go (about)

     1  /*
     2   * Copyright (c) 2022 tursom. All rights reserved.
     3   * Use of this source code is governed by a GPL-3
     4   * license that can be found in the LICENSE file.
     5   */
     6  
     7  package collections
     8  
     9  import (
    10  	"fmt"
    11  	"testing"
    12  
    13  	"github.com/tursom/GoCollections/lang"
    14  )
    15  
    16  func TestHashMap_put(t *testing.T) {
    17  	m := NewHashMap[lang.Int, int]()
    18  	for i := 0; i < 100; i++ {
    19  		fmt.Println(m)
    20  		m.Put(lang.Int(i), i+1)
    21  	}
    22  	fmt.Println(m)
    23  	m.resize()
    24  	fmt.Println(m)
    25  }