-
Notifications
You must be signed in to change notification settings - Fork 7
/
ipc_test.go
executable file
·209 lines (172 loc) · 3.32 KB
/
ipc_test.go
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
package client
import (
"os"
"reflect"
"testing"
)
var ipctest = MustClient(os.Getenv("HYPRLAND_INSTANCE_SIGNATURE"))
func Test_ipc_Clients(t *testing.T) {
got, err := ipctest.Clients()
if err != nil {
t.Error(err)
}
if len(got) == 0 {
t.Error("got is empty")
}
for _, client := range got {
if reflect.DeepEqual(client, Client{}) {
t.Errorf("got empty struct")
}
}
}
func Test_ipc_Workspaces(t *testing.T) {
got, err := ipctest.Workspaces()
if err != nil {
t.Error(err)
}
if len(got) == 0 {
t.Error("got is empty")
}
for _, workspace := range got {
if reflect.DeepEqual(workspace, Workspace{}) {
t.Errorf("got empty struct")
}
}
}
func Test_ipc_ActiveWorkspaces(t *testing.T) {
got, err := ipctest.ActiveWorkspace()
if err != nil {
t.Error(err)
}
if reflect.DeepEqual(got, Workspace{}) {
t.Errorf("got empty struct")
}
}
func Test_ipc_Monitors(t *testing.T) {
got, err := ipctest.Monitors()
if err != nil {
t.Error(err)
}
if len(got) == 0 {
t.Error("got is empty")
}
for _, workspace := range got {
if reflect.DeepEqual(workspace, Workspace{}) {
t.Errorf("got empty struct")
}
}
}
func Test_ipc_ActiveWindow(t *testing.T) {
got, err := ipctest.ActiveWindow()
if err != nil {
t.Error(err)
}
if reflect.DeepEqual(got, ActiveWindow{}) {
t.Errorf("got empty struct")
}
}
func Test_ipc_Layer(t *testing.T) {
got, err := ipctest.Layers()
if err != nil {
t.Error(err)
}
if reflect.DeepEqual(got, Layer{}) {
t.Errorf("got empty struct")
}
}
func Test_ipc_Devices(t *testing.T) {
got, err := ipctest.Devices()
if err != nil {
t.Error(err)
}
if reflect.DeepEqual(got, Devices{}) {
t.Errorf("got empty struct")
}
}
func Test_ipc_Version(t *testing.T) {
got, err := ipctest.Version()
if err != nil {
t.Error(err)
}
if reflect.DeepEqual(got, Version{}) {
t.Errorf("got empty struct")
}
}
func Test_ipc_Keyword(t *testing.T) {
q := NewByteQueue()
q.Add([]byte("general:border_size 1"))
err := ipctest.Keyword(q)
if err != nil {
t.Error(err)
}
}
func Test_ipc_Kill(t *testing.T) {
//err := ipctest.Kill()
//if err != nil {
// t.Error(err)
//}
//
}
func Test_ipc_Reload(t *testing.T) {
err := ipctest.Reload()
if err != nil {
t.Error(err)
}
}
func Test_ipc_Splash(t *testing.T) {
got, err := ipctest.Splash()
if err != nil {
t.Error(err)
}
if got == "" {
t.Error("got is empty")
}
}
func Test_ipc_SetCursor(t *testing.T) {
err := ipctest.SetCursor("Bibata-Modern-Classic", "24")
if err != nil {
t.Error(err)
}
}
func Test_ipc_GetOption(t *testing.T) {
got, err := ipctest.GetOption("general:border_size")
if err != nil {
t.Error(err)
}
if got == "" {
t.Error("got is empty")
}
}
func Test_ipc_CursorPos(t *testing.T) {
got, err := ipctest.CursorPos()
if err != nil {
t.Error(err)
}
if reflect.DeepEqual(got, CursorPos{}) {
t.Errorf("got empty struct")
}
}
func TestIpc_Dispatch(t *testing.T) {
q := NewByteQueue()
q.Add([]byte("exec kitty"))
q.Add([]byte("exec kitty"))
q.Add([]byte("exec kitty"))
_, err := ipctest.Dispatch(q)
if err != nil {
t.Error(err)
}
}
func Test_ipc_Binds(t *testing.T) {
got, err := ipctest.Binds()
if err != nil {
t.Error(err)
}
if len(got) == 0 {
t.Error("got is empty")
}
for _, bind := range got {
if reflect.DeepEqual(bind, Bind{}) {
t.Errorf("got empty struct")
}
}
}