summaryrefslogtreecommitdiffstats
path: root/src/history_test.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-06-15 22:45:31 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-06-15 22:45:31 +0900
commite720f56ea8f01d17baa600e0f212cee8ba7cc53c (patch)
tree04fdd0ca122bb85f139451679a74b132c4c944b9 /src/history_test.go
parent7db53e645923944a711e81515a2fcc5bb014f81f (diff)
Fix test code for docker build
Diffstat (limited to 'src/history_test.go')
-rw-r--r--src/history_test.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/history_test.go b/src/history_test.go
index 83e40297..fa6f1066 100644
--- a/src/history_test.go
+++ b/src/history_test.go
@@ -1,6 +1,7 @@
package fzf
import (
+ "os/user"
"testing"
)
@@ -8,7 +9,12 @@ func TestHistory(t *testing.T) {
maxHistory := 50
// Invalid arguments
- for _, path := range []string{"/etc", "/proc", "/etc/sudoers"} {
+ user, _ := user.Current()
+ paths := []string{"/etc", "/proc"}
+ if user.Name != "root" {
+ paths = append(paths, "/etc/sudoers")
+ }
+ for _, path := range paths {
if _, e := NewHistory(path, maxHistory); e == nil {
t.Error("Error expected for: " + path)
}