-
Notifications
You must be signed in to change notification settings - Fork 0
/
ini_test.go
63 lines (52 loc) · 1.11 KB
/
ini_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
Copyright © 2019, 2024 M.Watermann, 10247 Berlin, Germany
All rights reserved
EMail : <[email protected]>
*/
package ini
import (
"runtime"
"testing"
)
//lint:file-ignore ST1017 - I prefer Yoda conditions
func TestNewIni(t *testing.T) {
fName := "testIn.ini"
tests := []struct {
name string
filename string
// want *TSectionList
wantErr bool
}{
{"0", "", true},
{"1", fName, false},
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
_, err := NewIni(tt.filename)
if (err != nil) != tt.wantErr {
t.Errorf("%q: NewIni() error = %q, wantErr %v",
tt.name, err, tt.wantErr)
return
}
})
}
} // TestNewIni()
const cmpstring = "qwertzuiopü+#äölkjhgfdsa<yxcvbnm,.-^1234567890ß´qwertzuiop"
func Benchmark_compare1(b *testing.B) {
runtime.GOMAXPROCS(1)
for n := 0; n < b.N<<5; n++ {
if "" == cmpstring {
continue
}
}
} // Benchmark_compare1()
func Benchmark_compare2(b *testing.B) {
runtime.GOMAXPROCS(1)
for n := 0; n < b.N<<5; n++ {
if 0 == len(cmpstring) {
continue
}
}
} // Benchmark_compare2()
/* _EoF_ */