fix(lint): make compatibility test assertions fatal
This commit is contained in:
1 parent
e087f1b736
commit
c3fc4331c1
2 files changed
+5
-9
No files matched your search
@@ -782,9 +782,7 @@ func TestExtractGeminiUsage(t *testing.T) {
|
||||
}
|
||||
return
|
||||
}
|
||||
if got == nil {
|
||||
t.Fatalf("期望返回非 nil,实际返回 nil")
|
||||
}
|
||||
require.NotNil(t, got)
|
||||
if got.InputTokens != tt.wantUsage.InputTokens {
|
||||
t.Errorf("InputTokens: 期望 %d,实际 %d", tt.wantUsage.InputTokens, got.InputTokens)
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package service
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestCodexSnapshotBaseTime(t *testing.T) {
|
||||
@@ -50,9 +52,7 @@ func TestCodexResetAtRFC3339(t *testing.T) {
|
||||
t.Run("positive seconds", func(t *testing.T) {
|
||||
sec := 90
|
||||
got := codexResetAtRFC3339(base, &sec)
|
||||
if got == nil {
|
||||
t.Fatal("expected non-nil")
|
||||
}
|
||||
require.NotNil(t, got)
|
||||
if *got != "2026-02-16T10:01:30Z" {
|
||||
t.Fatalf("got %s, want %s", *got, "2026-02-16T10:01:30Z")
|
||||
}
|
||||
@@ -61,9 +61,7 @@ func TestCodexResetAtRFC3339(t *testing.T) {
|
||||
t.Run("negative seconds clamp to base", func(t *testing.T) {
|
||||
sec := -3
|
||||
got := codexResetAtRFC3339(base, &sec)
|
||||
if got == nil {
|
||||
t.Fatal("expected non-nil")
|
||||
}
|
||||
require.NotNil(t, got)
|
||||
if *got != "2026-02-16T10:00:00Z" {
|
||||
t.Fatalf("got %s, want %s", *got, "2026-02-16T10:00:00Z")
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user