Mercurial > irccd
comparison tests/src/irccdctl/cli-server-invite/main.cpp @ 743:473ce856c161
Tests: add irccdctl server-* tests #785
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 26 Jul 2018 12:29:00 +0200 |
parents | |
children | 903415e8ee2e |
comparison
equal
deleted
inserted
replaced
742:d3660cbf2f3c | 743:473ce856c161 |
---|---|
1 /* | |
2 * main.cpp -- test irccdctl server-invite | |
3 * | |
4 * Copyright (c) 2013-2018 David Demelier <markand@malikania.fr> | |
5 * | |
6 * Permission to use, copy, modify, and/or distribute this software for any | |
7 * purpose with or without fee is hereby granted, provided that the above | |
8 * copyright notice and this permission notice appear in all copies. | |
9 * | |
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
17 */ | |
18 | |
19 #define BOOST_TEST_MODULE "irccdctl server-invite" | |
20 #include <boost/test/unit_test.hpp> | |
21 | |
22 #include <irccd/test/server_cli_test.hpp> | |
23 | |
24 namespace irccd { | |
25 | |
26 namespace { | |
27 | |
28 BOOST_FIXTURE_TEST_SUITE(server_invite_suite, server_cli_test) | |
29 | |
30 BOOST_AUTO_TEST_CASE(output) | |
31 { | |
32 start(); | |
33 | |
34 const auto [code, out, err] = exec({ "server-invite", "test", "francis", "#staff" }); | |
35 | |
36 BOOST_TEST(!code); | |
37 BOOST_TEST(out.size() == 0U); | |
38 BOOST_TEST(err.size() == 0U); | |
39 | |
40 const auto cmd = server_->find("invite"); | |
41 | |
42 BOOST_TEST(cmd.size() == 1U); | |
43 BOOST_TEST(std::any_cast<std::string>(cmd[0][0]) == "francis"); | |
44 BOOST_TEST(std::any_cast<std::string>(cmd[0][1]) == "#staff"); | |
45 } | |
46 | |
47 BOOST_AUTO_TEST_SUITE_END() | |
48 | |
49 } // !namespace | |
50 | |
51 } // !irccd |