MCPcopy
hub / github.com/austingebauer/go-leetcode / TestLRUCache_3

Function TestLRUCache_3

lru_cache_146/solution_test.go:33–41  ·  view source on GitHub ↗

* ["LRUCache","put","get","put","get","get"] [[1],[2,1],[2],[3,2],[2],[3]] */

(t *testing.T)

Source from the content-addressed store, hash-verified

31[[1],[2,1],[2],[3,2],[2],[3]]
32*/
33func TestLRUCache_3(t *testing.T) {
34 cache := Constructor(1)
35 cache.Put(2, 1)
36 assert.Equal(t, 1, cache.Get(2))
37
38 cache.Put(3, 2)
39 assert.Equal(t, -1, cache.Get(2))
40 assert.Equal(t, 2, cache.Get(3))
41}
42
43/*
44["LRUCache","put","put","get","put","put","get"]

Callers

nothing calls this directly

Calls 3

PutMethod · 0.80
ConstructorFunction · 0.70
GetMethod · 0.45

Tested by

no test coverage detected