MCPcopy Create free account
hub / github.com/devfeel/dotweb / TestItemContext_Current

Function TestItemContext_Current

core/concurrenceMap_test.go:48–67  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

46}
47
48func TestItemContext_Current(t *testing.T) {
49 lock := &sync.Mutex{}
50 j := 0
51 for i := 0; i < 9; i++ {
52 go func() {
53 lock.Lock()
54 fmt.Println("go", j)
55 j++
56 v := "bar" + strconv.Itoa(j)
57 fmt.Println(v)
58 ic.Set(strconv.Itoa(j), v)
59 lock.Unlock()
60 }()
61 }
62
63 time.Sleep(3 * time.Second)
64
65 t.Log(ic.GetCurrentMap())
66
67}
68
69// 性能测试
70

Callers

nothing calls this directly

Calls 2

SetMethod · 0.65
GetCurrentMapMethod · 0.65

Tested by

no test coverage detected