diff options
| author | Carlos Martín Nieto <[email protected]> | 2014-06-07 18:33:09 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <[email protected]> | 2014-06-07 18:57:46 +0200 |
| commit | 12a3a1e05c03fdc9767ef62e5ff9e0d677946525 (patch) | |
| tree | 0bcdb684f1aa161dead4eb36cc1644554666fda3 /settings_test.go | |
| parent | aabeb7f585da1cf966191886eab732db0020a41a (diff) | |
Move the settings into the main git2go
Diffstat (limited to 'settings_test.go')
| -rw-r--r-- | settings_test.go | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/settings_test.go b/settings_test.go new file mode 100644 index 0000000..3a4ce0a --- /dev/null +++ b/settings_test.go @@ -0,0 +1,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") + } +} |
