From 320de746f7a2985b60c8564a0e65bdf231e840b7 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 6 Sep 2025 10:56:27 +0300 Subject: use gofumpt --- internal/lsp/debounce_throttle_more_test.go | 51 ++++++++++++++--------------- 1 file changed, 25 insertions(+), 26 deletions(-) (limited to 'internal/lsp/debounce_throttle_more_test.go') diff --git a/internal/lsp/debounce_throttle_more_test.go b/internal/lsp/debounce_throttle_more_test.go index cb11ea4..ed61336 100644 --- a/internal/lsp/debounce_throttle_more_test.go +++ b/internal/lsp/debounce_throttle_more_test.go @@ -1,36 +1,35 @@ package lsp import ( - "context" - "testing" - "time" + "context" + "testing" + "time" ) func TestWaitForDebounce_WaitsRoughlyDebounce(t *testing.T) { - s := newTestServer() - s.completionDebounce = 20 * time.Millisecond - s.mu.Lock() - s.lastInput = time.Now() - s.mu.Unlock() - start := time.Now() - s.waitForDebounce(context.Background()) - if elapsed := time.Since(start); elapsed < 15*time.Millisecond { - t.Fatalf("debounce did not wait long enough: %v", elapsed) - } + s := newTestServer() + s.completionDebounce = 20 * time.Millisecond + s.mu.Lock() + s.lastInput = time.Now() + s.mu.Unlock() + start := time.Now() + s.waitForDebounce(context.Background()) + if elapsed := time.Since(start); elapsed < 15*time.Millisecond { + t.Fatalf("debounce did not wait long enough: %v", elapsed) + } } func TestWaitForThrottle_WaitsRoughlyInterval(t *testing.T) { - s := newTestServer() - s.throttleInterval = 20 * time.Millisecond - s.mu.Lock() - s.lastLLMCall = time.Now() - s.mu.Unlock() - start := time.Now() - if !s.waitForThrottle(context.Background()) { - t.Fatalf("waitForThrottle returned false") - } - if elapsed := time.Since(start); elapsed < 15*time.Millisecond { - t.Fatalf("throttle did not wait long enough: %v", elapsed) - } + s := newTestServer() + s.throttleInterval = 20 * time.Millisecond + s.mu.Lock() + s.lastLLMCall = time.Now() + s.mu.Unlock() + start := time.Now() + if !s.waitForThrottle(context.Background()) { + t.Fatalf("waitForThrottle returned false") + } + if elapsed := time.Since(start); elapsed < 15*time.Millisecond { + t.Fatalf("throttle did not wait long enough: %v", elapsed) + } } - -- cgit v1.2.3