MCPcopy Create free account
hub / github.com/buke/quickjs-go / TestHandleStore_ZeroValues

Function TestHandleStore_ZeroValues

handle_test.go:260–280  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

258}
259
260func TestHandleStore_ZeroValues(t *testing.T) {
261 hs := newHandleStore()
262
263 // Test storing zero values
264 zeroValues := []interface{}{
265 "", // empty string
266 0, // zero int
267 false, // false bool
268 []int{}, // empty slice
269 map[int]int{}, // empty map
270 nil, // nil value
271 }
272
273 for i, zeroValue := range zeroValues {
274 id := hs.Store(zeroValue)
275 value, ok := hs.Load(id)
276 assert.True(t, ok)
277 assert.Equal(t, zeroValue, value, "Zero value %d should be stored correctly", i)
278 assert.True(t, hs.Delete(id))
279 }
280}
281
282func TestHandleStore_FunctionTypes(t *testing.T) {
283 hs := newHandleStore()

Callers

nothing calls this directly

Calls 5

newHandleStoreFunction · 0.85
StoreMethod · 0.80
LoadMethod · 0.80
EqualMethod · 0.80
DeleteMethod · 0.45

Tested by

no test coverage detected