File tree Expand file tree Collapse file tree 3 files changed +6
-27
lines changed Expand file tree Collapse file tree 3 files changed +6
-27
lines changed Original file line number Diff line number Diff line change @@ -6,18 +6,11 @@ import (
66 "github.com/alecthomas/assert/v2"
77)
88
9- var completions []string
10-
119func BenchmarkNameplateCompletion (b * testing.B ) {
1210 c := Client {}
13-
14- local := []string {}
15-
16- for range b .N {
17- local = c .GenerateCodeCompletion ("1-letterhead-be" )
11+ for b .Loop () {
12+ c .GenerateCodeCompletion ("1-letterhead-be" )
1813 }
19-
20- completions = local
2114}
2215
2316func TestCompletionGeneration_Progressive (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -5,24 +5,15 @@ import (
55 "testing"
66
77 "fyne.io/fyne/v2/app"
8- "fyne.io/fyne/v2/container"
98)
109
11- var globalTabs * container.AppTabs
12-
1310func BenchmarkCreate (b * testing.B ) {
14- b .StopTimer ()
1511 a := app .NewWithID ("io.github.jacalz.rymdport" )
1612 w := a .NewWindow ("Rymdport" )
17- var tabs * container.AppTabs
1813 os .Args = []string {"rymdport" } // Don't read test arguments as uri input.
19- b .StartTimer ()
2014
2115 b .ReportAllocs ()
22- for range b . N {
23- tabs = Create (a , w )
16+ for b . Loop () {
17+ Create (a , w )
2418 }
25-
26- // Don't allow the compiler to optimize out.
27- globalTabs = tabs
2819}
Original file line number Diff line number Diff line change @@ -9,16 +9,11 @@ import (
99 "github.com/alecthomas/assert/v2"
1010)
1111
12- var globalValidationError error
13-
1412func BenchmarkCodeValidator (b * testing.B ) {
15- local := error (nil )
16-
17- for range b .N {
18- local = CodeValidator ("125-upset-universe-mistake" )
13+ for b .Loop () {
14+ CodeValidator ("125-upset-universe-mistake" )
1915 }
2016
21- globalValidationError = local
2217}
2318
2419var codeValidatorTestcases = []struct {
You can’t perform that action at this time.
0 commit comments