forked from libgit2/git2go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings_test.go
50 lines (39 loc) · 865 Bytes
/
settings_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
package git
import (
"testing"
)
type pathPair struct {
Level ConfigLevel
Path string
}
func TestSearchPath(t *testing.T) {
paths := []pathPair{
pathPair{ConfigLevelSystem, "/tmp/system"},
pathPair{ConfigLevelGlobal, "/tmp/global"},
pathPair{ConfigLevelXDG, "/tmp/xdg"},
}
for _, pair := range paths {
err := SetSearchPath(pair.Level, pair.Path)
checkFatal(t, err)
actual, err := SearchPath(pair.Level)
checkFatal(t, err)
if pair.Path != actual {
t.Fatal("Search paths don't match")
}
}
}
func TestMmapSizes(t *testing.T) {
size := 42 * 1024
err := SetMwindowSize(size)
checkFatal(t, err)
actual, err := MwindowSize()
if size != actual {
t.Fatal("Sizes don't match")
}
err = SetMwindowMappedLimit(size)
checkFatal(t, err)
actual, err = MwindowMappedLimit()
if size != actual {
t.Fatal("Sizes don't match")
}
}