mirror of
https://gitea.com/gitea/gitea-mcp.git
synced 2026-02-27 09:05:12 +00:00
refactor(test): use strings.Contains directly instead of wrapper
Remove the custom contains() wrapper function in params_test.go and use strings.Contains directly as suggested in review. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -87,7 +87,7 @@ func TestGetIndex(t *testing.T) {
|
|||||||
t.Errorf("GetIndex() expected error but got nil")
|
t.Errorf("GetIndex() expected error but got nil")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if tt.errMsg != "" && !contains(err.Error(), tt.errMsg) {
|
if tt.errMsg != "" && !strings.Contains(err.Error(), tt.errMsg) {
|
||||||
t.Errorf("GetIndex() error = %v, want error containing %q", err, tt.errMsg)
|
t.Errorf("GetIndex() error = %v, want error containing %q", err, tt.errMsg)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@@ -102,7 +102,3 @@ func TestGetIndex(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func contains(s, substr string) bool {
|
|
||||||
return strings.Contains(s, substr)
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user