github.com/iEvan-lhr/exciting-tool@v0.0.0-20230504054234-8e983f73cdd2/map_test.go (about)

     1  package tools
     2  
     3  import (
     4  	"log"
     5  	"strconv"
     6  	"testing"
     7  )
     8  
     9  func TestMap(t *testing.T) {
    10  	//spider := MakeSpider(0, "999999")
    11  	m := make(map[string]int)
    12  	values := 999998
    13  	for i := 1; i < 999999; i++ {
    14  		//spider.Add(i, 999998)
    15  		m[strconv.Itoa(i)] = values
    16  		values--
    17  	}
    18  	//log.Println(spider.len)
    19  
    20  }
    21  
    22  func TestSpider(t *testing.T) {
    23  	spider := MakeSpider(0, "999999")
    24  	//m := make(map[string]int)
    25  	values := 999998
    26  	for i := 1; i < 999999; i++ {
    27  		spider.Add(i, values)
    28  		//m[strconv.Itoa(i)] = values
    29  		values--
    30  	}
    31  	log.Println(spider.Get(232))
    32  
    33  }