fix(handlers): correct two test-file bugs blocking the build #870

Merged
devops-engineer merged 3 commits from fix/handlers-test-build-fixes into staging 2026-05-13 18:39:15 +00:00
3 changed files with 4 additions and 3 deletions

View File

@ -248,7 +248,7 @@ func TestReadUsageMap_MissingUsage(t *testing.T) {
m := map[string]json.RawMessage{
"other": json.RawMessage(`{}`),
}
in, out, ok := readUsageMap(m)
_, _, ok := readUsageMap(m)
if ok {
t.Errorf("readUsageMap returned ok=true for missing usage, want false")
}
@ -297,7 +297,7 @@ func TestReadUsageMap_MalformedUsageJSON(t *testing.T) {
m := map[string]json.RawMessage{
"usage": json.RawMessage(`not valid json`),
}
in, out, ok := readUsageMap(m)
_, _, ok := readUsageMap(m)
if ok {
t.Errorf("readUsageMap returned ok=true for malformed usage JSON, want false")
}

View File

@ -30,7 +30,7 @@ func TestSupportsRuntime_HyphenUnderscoreNormalized(t *testing.T) {
// "claude-code" and "claude_code" are considered equal.
info := pluginInfo{Name: "test", Runtimes: []string{"claude-code"}}
assert.True(t, info.supportsRuntime("claude_code"))
assert.True(t, info.supportsRuntime("anthropic_claude"))
assert.True(t, info.supportsRuntime("claude-code")) // symmetric hyphen form
}
func TestSupportsRuntime_HyphenVsUnderscoreReverse(t *testing.T) {

View File

@ -2,6 +2,7 @@ package handlers
import (
"context"
"database/sql"
"testing"
"github.com/DATA-DOG/go-sqlmock"