-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp_test.go
More file actions
51 lines (44 loc) · 904 Bytes
/
Copy pathapp_test.go
File metadata and controls
51 lines (44 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package main
import (
"testing"
)
func TestNewApp(t *testing.T) {
cfg := DefaultConfig()
app := NewApp(cfg, "/tmp")
if app == nil {
t.Fatal("NewApp returned nil")
}
if app.cwd == "" {
t.Error("NewApp: cwd is empty")
}
if app.config == nil {
t.Error("NewApp: config is nil")
}
if app.keys.Help.Keys() == nil {
t.Error("NewApp: keys not initialized")
}
if app.theme.CursorBg == "" {
t.Error("NewApp: theme not initialized")
}
if app.previewSvc == nil {
t.Error("NewApp: previewSvc is nil")
}
}
func TestNewAppDefaultDir(t *testing.T) {
cfg := DefaultConfig()
app := NewApp(cfg, "")
if app == nil {
t.Fatal("NewApp returned nil")
}
if app.cwd == "" {
t.Error("NewApp with empty dir: cwd is empty")
}
}
func TestAppInit(t *testing.T) {
cfg := DefaultConfig()
app := NewApp(cfg, "/tmp")
cmd := app.Init()
if cmd == nil {
t.Error("Init returned nil cmd")
}
}