about summary refs log tree commit diff stats
path: root/tests/functionaltests/test_disconnect.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-01-05 01:30:32 +0000
committerJames Booth <boothj5@gmail.com>2016-01-05 01:30:32 +0000
commite1e0fda8b307270045a744f1325e8d88032f65b9 (patch)
tree97350cd39b427724931dfe6c78187c4db3a37e65 /tests/functionaltests/test_disconnect.c
parent8e9bf083895ba7101115594a39dace62a59ab28f (diff)
downloadprofani-tty-e1e0fda8b307270045a744f1325e8d88032f65b9.tar.gz
Call UI disconnect functions before disconnecting with /disconnect
fixes #703
Diffstat (limited to 'tests/functionaltests/test_disconnect.c')
-rw-r--r--tests/functionaltests/test_disconnect.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/functionaltests/test_disconnect.c b/tests/functionaltests/test_disconnect.c
new file mode 100644
index 00000000..7529da18
--- /dev/null
+++ b/tests/functionaltests/test_disconnect.c
@@ -0,0 +1,24 @@
+#include <glib.h>
+#include <stdarg.h>
+#include <stddef.h>
+#include <setjmp.h>
+#include <cmocka.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <stabber.h>
+#include <expect.h>
+
+#include "proftest.h"
+
+void
+disconnect_ends_session(void **state)
+{
+    prof_connect();
+
+    prof_input("/disconnect");
+    assert_true(prof_output_exact("stabber@localhost/profanity logged out successfully."));
+
+    prof_input("/roster");
+    assert_true(prof_output_exact("You are not currently connected."));
+}
'#n170'>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