This commit is contained in:
Daisuke Maki 2014-06-25 12:48:25 +09:00
parent 1cf021c6db
commit 63aabf3cbd
2 changed files with 11 additions and 12 deletions

View file

@ -2,11 +2,11 @@ package peco
import (
"encoding/json"
"path/filepath"
"fmt"
"io/ioutil"
"os"
"os/user"
"path/filepath"
"strings"
"testing"
@ -80,18 +80,18 @@ func TestLocateRcfile(t *testing.T) {
}
expected := []string{
filepath.Join(dir, "peco"),
filepath.Join(dir, "1", "peco"),
filepath.Join(dir, "2", "peco"),
filepath.Join(dir, "3", "peco"),
filepath.Join(dir, ".peco"),
filepath.Join(dir, "peco"),
filepath.Join(dir, "1", "peco"),
filepath.Join(dir, "2", "peco"),
filepath.Join(dir, "3", "peco"),
filepath.Join(dir, ".peco"),
}
i := 0
_locateRcfileIn = func(dir string) (string, error) {
t.Logf("looking for file in %s", dir)
if i > len(expected) - 1 {
t.Fatalf("Got %d directories, only have %d", i + 1, len(expected))
if i > len(expected)-1 {
t.Fatalf("Got %d directories, only have %d", i+1, len(expected))
}
if expected[i] != dir {
@ -117,5 +117,4 @@ func TestLocateRcfile(t *testing.T) {
i = 0
LocateRcfile()
}

View file

@ -39,9 +39,9 @@ func TestKeymapStrToKeyValue(t *testing.T) {
func TestKeymapStrToKeyValueWithAlt(t *testing.T) {
expected := map[string]termbox.Key{
"M-v": termbox.Key('v'),
"M-C-v": termbox.KeyCtrlV,
"M-Space": termbox.KeySpace,
"M-v": termbox.Key('v'),
"M-C-v": termbox.KeyCtrlV,
"M-Space": termbox.KeySpace,
"M-MouseLeft": termbox.MouseLeft,
}