comparison tests/src/plugins/hangman/main.cpp @ 741:cc01813fa027

Tests: improve file naming consistency
author David Demelier <markand@malikania.fr>
date Wed, 25 Jul 2018 22:02:00 +0200
parents 64839725f346
children 791d7591eca7
comparison
equal deleted inserted replaced
740:7088476813ab 741:cc01813fa027
172 172
173 BOOST_TEST(std::any_cast<std::string>(cmd[0]) == "#hangman"); 173 BOOST_TEST(std::any_cast<std::string>(cmd[0]) == "#hangman");
174 BOOST_TEST(std::any_cast<std::string>(cmd[1]) == "wrong-letter=hangman:!hangman:test:#hangman:jean!jean@localhost:jean:x"); 174 BOOST_TEST(std::any_cast<std::string>(cmd[1]) == "wrong-letter=hangman:!hangman:test:#hangman:jean!jean@localhost:jean:x");
175 } 175 }
176 176
177 BOOST_AUTO_TEST_CASE(wrongWord) 177 BOOST_AUTO_TEST_CASE(wrong_word)
178 { 178 {
179 load(); 179 load();
180 180
181 plugin_->handle_command(irccd_, { server_, "jean!jean@localhost", "#hangman", "" }); 181 plugin_->handle_command(irccd_, { server_, "jean!jean@localhost", "#hangman", "" });
182 plugin_->handle_command(irccd_, { server_, "jean!jean@localhost", "#hangman", "cheese" }); 182 plugin_->handle_command(irccd_, { server_, "jean!jean@localhost", "#hangman", "cheese" });
231 231
232 BOOST_TEST(std::any_cast<std::string>(cmd[0]) == "#hangman"); 232 BOOST_TEST(std::any_cast<std::string>(cmd[0]) == "#hangman");
233 BOOST_TEST(std::any_cast<std::string>(cmd[1]) == "found=hangman:!hangman:test:#hangman:francis!francis@localhost:francis:s k _"); 233 BOOST_TEST(std::any_cast<std::string>(cmd[1]) == "found=hangman:!hangman:test:#hangman:francis!francis@localhost:francis:s k _");
234 } 234 }
235 235
236 BOOST_AUTO_TEST_CASE(case_fix_642) 236 BOOST_AUTO_TEST_CASE(issue_642)
237 { 237 {
238 load(); 238 load();
239 239
240 plugin_->handle_command(irccd_, { server_, "jean!jean@localhost", "#hangman", "" }); 240 plugin_->handle_command(irccd_, { server_, "jean!jean@localhost", "#hangman", "" });
241 plugin_->handle_message(irccd_, { server_, "jean!jean@localhost", "#HANGMAN", "s" }); 241 plugin_->handle_message(irccd_, { server_, "jean!jean@localhost", "#HANGMAN", "s" });
301 301
302 BOOST_TEST(std::any_cast<std::string>(cmd[0]) == "#hangman"); 302 BOOST_TEST(std::any_cast<std::string>(cmd[0]) == "#hangman");
303 BOOST_TEST(std::any_cast<std::string>(cmd[1]) == "running=hangman:!hangman:test:#hangman:jean!jean@localhost:jean:_ _ y"); 303 BOOST_TEST(std::any_cast<std::string>(cmd[1]) == "running=hangman:!hangman:test:#hangman:jean!jean@localhost:jean:_ _ y");
304 } 304 }
305 305
306 BOOST_AUTO_TEST_CASE(wordlist_fix_644) 306 BOOST_AUTO_TEST_CASE(issue_644)
307 { 307 {
308 /* 308 /*
309 * To be sure that the selection use the same list, we create a list of 309 * To be sure that the selection use the same list, we create a list of
310 * three words that has different size to determine which one was selected. 310 * three words that has different size to determine which one was selected.
311 * 311 *
312 * Then we run 3 games and verify that the old selection is not the same 312 * Then we run 3 games and verify that the old selection is not the same
313 * as the current. 313 * as the current.
314 * 314 *
315 * This is not very accurate but it's better than nothing. 315 * This is not very accurate but it's better than nothing.
316 */ 316 */
317 load({{ "file", CMAKE_CURRENT_SOURCE_DIR "/wordlist_fix_644.conf" }}); 317 load({{ "file", CMAKE_CURRENT_SOURCE_DIR "/issue-644.conf" }});
318 318
319 std::unordered_map<unsigned, std::string> words{ 319 std::unordered_map<unsigned, std::string> words{
320 { 5, "abc" }, 320 { 5, "abc" },
321 { 7, "abcd" }, 321 { 7, "abcd" },
322 { 9, "abcde" } 322 { 9, "abcde" }