(t *testing.T)
| 147 | } |
| 148 | |
| 149 | func TestClearCache(t *testing.T) { |
| 150 | r := New(100 * time.Millisecond) |
| 151 | |
| 152 | r.ResolveAddr("127.0.0.1") |
| 153 | r.ResolvePort(80, "tcp") |
| 154 | |
| 155 | if r.GetCacheSize() == 0 { |
| 156 | t.Error("expected non-empty cache before clear") |
| 157 | } |
| 158 | |
| 159 | r.ClearCache() |
| 160 | |
| 161 | if r.GetCacheSize() != 0 { |
| 162 | t.Errorf("expected empty cache after clear, got %d", r.GetCacheSize()) |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | func TestGetCacheSize(t *testing.T) { |
| 167 | r := New(100 * time.Millisecond) |
nothing calls this directly
no test coverage detected