| 1 | // Copyright 2024 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | package lru_test |
| 6 | |
| 7 | import ( |
| 8 | "testing" |
| 9 | |
| 10 | "golang.org/x/tools/gopls/internal/util/lru" |
| 11 | ) |
| 12 | |
| 13 | func TestSetUntypedNil(t *testing.T) { |
| 14 | cache := lru.New[any, any](100 * 1e6) |
| 15 | cache.Set(nil, nil, 1) |
| 16 | if got, ok := cache.Get(nil); !ok || got != nil { |
| 17 | t.Errorf("cache.Get(nil) = %v, %v, want nil, true", got, ok) |
| 18 | } |
| 19 | } |