forked from proxypoke/i3ipc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubscribe_test.go
32 lines (28 loc) · 880 Bytes
/
subscribe_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
// Author: slowpoke <mail plus git at slowpoke dot io>
// Repository: https://github.com/proxypoke/i3ipc
//
// This program is free software under the terms of the
// Do What The Fuck You Want To Public License.
// It comes without any warranty, to the extent permitted by
// applicable law. For a copy of the license, see COPYING or
// head to http://sam.zoy.org/wtfpl/COPYING.
package i3ipc
import (
"testing"
)
func TestInit(t *testing.T) {
for _, s := range eventSockets {
if !s.open {
t.Error("Init failed: closed event socket found.")
}
}
if len(eventSockets) != int(eventmax) {
t.Errorf("Too much or not enough event sockets. Got %d, expected %d.\n",
len(eventSockets), int(eventmax))
}
_, err := Subscribe(I3WorkspaceEvent)
if err != nil {
t.Errorf("Failed to subscribe: %f\n")
}
// TODO: A test to ensure that subscriptions work as intended.
}