MCPcopy
hub / github.com/cornelk/hashmap / TestSetFloat32

Function TestSetFloat32

hashmap_test.go:79–93  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

77}
78
79func TestSetFloat32(t *testing.T) {
80 t.Parallel()
81 m := New[float32, int]()
82
83 m.Set(1.1, 128) // insert
84 value, ok := m.Get(1.1)
85 assert.True(t, ok)
86 assert.Equal(t, 128, value)
87
88 m.Set(2.2, 200) // insert
89 assert.Equal(t, 2, m.Len())
90 value, ok = m.Get(2.2)
91 assert.True(t, ok)
92 assert.Equal(t, 200, value)
93}
94
95func TestSetFloat64(t *testing.T) {
96 t.Parallel()

Callers

nothing calls this directly

Calls 6

TrueFunction · 0.92
EqualFunction · 0.92
NewFunction · 0.85
SetMethod · 0.80
GetMethod · 0.80
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…