Skip to content

Commit 239943a

Browse files
committed
fix benchmark code
1 parent 6ceadc6 commit 239943a

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

.github/workflows/test.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ jobs:
1212
matrix:
1313
os: [windows-latest, macos-latest, ubuntu-latest]
1414
go:
15-
- "1.15"
16-
- "1.16"
17-
- "1.17"
18-
- "1.18"
19-
- "1.19"
15+
- "1.22"
16+
- "1.21"
2017
- "1.20"
18+
- "1.19"
19+
- "1.18"
2120
runs-on: ${{ matrix.os }}
2221
steps:
2322
- uses: actions/checkout@v3

benchmark_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ func benchRuneWidth(b *testing.B, eastAsianWidth bool, start, stop rune, want in
5353
return n
5454
}
5555
func BenchmarkRuneWidthAll(b *testing.B) {
56-
benchSink = benchRuneWidth(b, false, 0, utf8.MaxRune+1, 1293942)
56+
benchSink = benchRuneWidth(b, false, 0, utf8.MaxRune+1, 1293933)
5757
}
5858
func BenchmarkRuneWidth768(b *testing.B) {
5959
benchSink = benchRuneWidth(b, false, 0, 0x300, 702)
6060
}
6161
func BenchmarkRuneWidthAllEastAsian(b *testing.B) {
62-
benchSink = benchRuneWidth(b, true, 0, utf8.MaxRune+1, 1432568)
62+
benchSink = benchRuneWidth(b, true, 0, utf8.MaxRune+1, 1432559)
6363
}
6464
func BenchmarkRuneWidth768EastAsian(b *testing.B) {
6565
benchSink = benchRuneWidth(b, true, 0, 0x300, 794)
@@ -113,21 +113,19 @@ func benchString1Width(b *testing.B, eastAsianWidth bool, start, stop rune, want
113113
return n
114114
}
115115
func BenchmarkString1WidthAll(b *testing.B) {
116-
benchSink = benchString1Width(b, false, 0, utf8.MaxRune+1, 1295990)
116+
benchSink = benchString1Width(b, false, 0, utf8.MaxRune+1, 1295981)
117117
}
118118
func BenchmarkString1Width768(b *testing.B) {
119119
benchSink = benchString1Width(b, false, 0, 0x300, 702)
120120
}
121121
func BenchmarkString1WidthAllEastAsian(b *testing.B) {
122-
benchSink = benchString1Width(b, true, 0, utf8.MaxRune+1, 1436664)
122+
benchSink = benchString1Width(b, true, 0, utf8.MaxRune+1, 1436655)
123123
}
124124
func BenchmarkString1Width768EastAsian(b *testing.B) {
125125
benchSink = benchString1Width(b, true, 0, 0x300, 794)
126126
}
127127

128-
//
129128
// tables
130-
//
131129
func benchTable(b *testing.B, tbl table) int {
132130
n := 0
133131
for i := 0; i < b.N; i++ {

0 commit comments

Comments
 (0)