MCPcopy
hub / github.com/github/gh-ost / TestParseLoadMap

Function TestParseLoadMap

go/base/load_map_test.go:19–44  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17}
18
19func TestParseLoadMap(t *testing.T) {
20 {
21 loadList := ""
22 m, err := ParseLoadMap(loadList)
23 require.NoError(t, err)
24 require.Len(t, m, 0)
25 }
26 {
27 loadList := "threads_running=20,threads_connected=10"
28 m, err := ParseLoadMap(loadList)
29 require.NoError(t, err)
30 require.Len(t, m, 2)
31 require.Equal(t, int64(20), m["threads_running"])
32 require.Equal(t, int64(10), m["threads_connected"])
33 }
34 {
35 loadList := "threads_running=20=30,threads_connected=10"
36 _, err := ParseLoadMap(loadList)
37 require.Error(t, err)
38 }
39 {
40 loadList := "threads_running=20,threads_connected"
41 _, err := ParseLoadMap(loadList)
42 require.Error(t, err)
43 }
44}
45
46func TestString(t *testing.T) {
47 {

Callers

nothing calls this directly

Calls 3

ParseLoadMapFunction · 0.85
ErrorMethod · 0.65
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…