mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-30 00:33:56 +00:00
Fix test code for docker build
This commit is contained in:
parent
7db53e6459
commit
e720f56ea8
@ -1,6 +1,7 @@
|
|||||||
package fzf
|
package fzf
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os/user"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -8,7 +9,12 @@ func TestHistory(t *testing.T) {
|
|||||||
maxHistory := 50
|
maxHistory := 50
|
||||||
|
|
||||||
// Invalid arguments
|
// 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 {
|
if _, e := NewHistory(path, maxHistory); e == nil {
|
||||||
t.Error("Error expected for: " + path)
|
t.Error("Error expected for: " + path)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user