MCPcopy Create free account
hub / github.com/austingebauer/go-leetcode / TestKV

Function TestKV

time_based_key_value_store_981/solution_test.go:9–18  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestKV(t *testing.T) {
10 kv := Constructor()
11 kv.Set("foo", "bar", 1)
12 kv.Set("foo", "baz", 4)
13 assert.Equal(t, "", kv.Get("foo", 0))
14 assert.Equal(t, "bar", kv.Get("foo", 3))
15 assert.Equal(t, "bar", kv.Get("foo", 2))
16 assert.Equal(t, "baz", kv.Get("foo", 4))
17 assert.Equal(t, "baz", kv.Get("foo", 6))
18}

Callers

nothing calls this directly

Calls 3

SetMethod · 0.80
ConstructorFunction · 0.70
GetMethod · 0.45

Tested by

no test coverage detected