2
0
mirror of https://github.com/junegunn/fzf synced 2024-11-18 09:28:40 +00:00

Fix test code for docker build

This commit is contained in:
Junegunn Choi 2015-06-15 22:45:31 +09:00
parent 7db53e6459
commit e720f56ea8

View File

@ -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)
}