summaryrefslogtreecommitdiff
path: root/test
blob: bf4d6977755f86a03cc911b50547b2ec0c61c3a3 (plain)
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
#!/usr/bin/expect -f
# Very basic end-to-end testing for CI

# Run the daemon to test against
system ./kike --write-default-cfg
spawn ./kike -d

# 10 seconds is a bit too much
set timeout 5

spawn ./degesch

# Fuck this Tcl shit, I want the exit code
expect_after {
	eof {
		puts ""
		puts "Child exited prematurely"
		exit 1
	}
}

# Connect to the daemon
send "/server add localhost\n"
expect "]"
send "/set servers.localhost.addresses = \"localhost\"\n"
expect "Option changed"
send "/disconnect\n"
expect "]"
send "/connect\n"
expect "Connection established"

# Try some chatting
send "/join #test\n"
expect "has joined"
send "Hello\n"
expect "Hello"

# Attributes
send "\x1bmbBold text! \x1bmc0,5And colors.\n"
expect "]"

# Try basic commands
send "/set\n"
expect "]"
send "/help\n"
expect "]"

# Quit
send "/quit\n"
expect "Shutting down"