See https://tip.golang.org/doc/go1.24#new-benchmark-function
@@ -22,7 +22,7 @@ func BenchmarkParse(b *testing.B) {
}
testCases[filename][1] = string(data)
- for range b.N {
+ for b.Loop() {
for _, v := range testCases {
ParseFeed(v[0], strings.NewReader(v[1]))
@@ -80,7 +80,7 @@ func TestEstimateReadingTime(t *testing.T) {
func BenchmarkEstimateReadingTime(b *testing.B) {
for _, sample := range samples {
EstimateReadingTime(sample, 200, 500)
@@ -25,7 +25,7 @@ func BenchmarkSanitize(b *testing.B) {
SanitizeHTMLWithDefaultOptions(v[0], v[1])