Mercurial > irccd
changeset 741:cc01813fa027
Tests: improve file naming consistency
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 25 Jul 2018 22:02:00 +0200 |
parents | 7088476813ab |
children | d3660cbf2f3c |
files | tests/src/plugins/hangman/CMakeLists.txt tests/src/plugins/hangman/issue-644.conf tests/src/plugins/hangman/main.cpp tests/src/plugins/hangman/wordlist_fix_644.conf tests/src/plugins/history/broken-conf.json tests/src/plugins/history/error.json tests/src/plugins/history/main.cpp tests/src/plugins/joke/CMakeLists.txt tests/src/plugins/joke/error-empty.json tests/src/plugins/joke/error-invalid.json tests/src/plugins/joke/error-not-array.json tests/src/plugins/joke/error-toobig.json tests/src/plugins/joke/jokes-empty.json tests/src/plugins/joke/jokes-invalid.json tests/src/plugins/joke/jokes-not-array.json tests/src/plugins/joke/jokes-toobig.json tests/src/plugins/joke/main.cpp |
diffstat | 17 files changed, 61 insertions(+), 61 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/src/plugins/hangman/CMakeLists.txt Wed Jul 25 21:41:00 2018 +0200 +++ b/tests/src/plugins/hangman/CMakeLists.txt Wed Jul 25 22:02:00 2018 +0200 @@ -21,7 +21,7 @@ SOURCES main.cpp words.conf - wordlist_fix_644.conf + issue-644.conf LIBRARIES libirccd FLAGS PLUGIN_PATH="${CMAKE_SOURCE_DIR}/plugins/hangman/hangman.js" )
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/src/plugins/hangman/issue-644.conf Wed Jul 25 22:02:00 2018 +0200 @@ -0,0 +1,3 @@ +abc +abcd +abcde
--- a/tests/src/plugins/hangman/main.cpp Wed Jul 25 21:41:00 2018 +0200 +++ b/tests/src/plugins/hangman/main.cpp Wed Jul 25 22:02:00 2018 +0200 @@ -174,7 +174,7 @@ BOOST_TEST(std::any_cast<std::string>(cmd[1]) == "wrong-letter=hangman:!hangman:test:#hangman:jean!jean@localhost:jean:x"); } -BOOST_AUTO_TEST_CASE(wrongWord) +BOOST_AUTO_TEST_CASE(wrong_word) { load(); @@ -233,7 +233,7 @@ BOOST_TEST(std::any_cast<std::string>(cmd[1]) == "found=hangman:!hangman:test:#hangman:francis!francis@localhost:francis:s k _"); } -BOOST_AUTO_TEST_CASE(case_fix_642) +BOOST_AUTO_TEST_CASE(issue_642) { load(); @@ -303,7 +303,7 @@ BOOST_TEST(std::any_cast<std::string>(cmd[1]) == "running=hangman:!hangman:test:#hangman:jean!jean@localhost:jean:_ _ y"); } -BOOST_AUTO_TEST_CASE(wordlist_fix_644) +BOOST_AUTO_TEST_CASE(issue_644) { /* * To be sure that the selection use the same list, we create a list of @@ -314,7 +314,7 @@ * * This is not very accurate but it's better than nothing. */ - load({{ "file", CMAKE_CURRENT_SOURCE_DIR "/wordlist_fix_644.conf" }}); + load({{ "file", CMAKE_CURRENT_SOURCE_DIR "/issue-644.conf" }}); std::unordered_map<unsigned, std::string> words{ { 5, "abc" },
--- a/tests/src/plugins/hangman/wordlist_fix_644.conf Wed Jul 25 21:41:00 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -abc -abcd -abcde
--- a/tests/src/plugins/history/broken-conf.json Wed Jul 25 21:41:00 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -this is not a json file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/src/plugins/history/error.json Wed Jul 25 22:02:00 2018 +0200 @@ -0,0 +1,1 @@ +this is not a json file
--- a/tests/src/plugins/history/main.cpp Wed Jul 25 21:41:00 2018 +0200 +++ b/tests/src/plugins/history/main.cpp Wed Jul 25 22:02:00 2018 +0200 @@ -58,7 +58,7 @@ BOOST_AUTO_TEST_CASE(format_error) { - load({{"file", CMAKE_CURRENT_SOURCE_DIR "/broken-conf.json"}}); + load({{"file", CMAKE_CURRENT_SOURCE_DIR "/error.json"}}); plugin_->handle_command(irccd_, { server_, "jean!jean@localhost", "#history", "seen francis" }); @@ -114,12 +114,12 @@ BOOST_TEST(std::any_cast<std::string>(cmd[1]) == "unknown=history:!history:test:#history:destructor!dst@localhost:destructor:nobody"); } -BOOST_AUTO_TEST_CASE(fix_642) +BOOST_AUTO_TEST_CASE(issue_642) { static const std::regex rule("said=history:!history:test:#history:destructor!dst@localhost:destructor:jean:hello:\\d{2}:\\d{2}"); - remove(CMAKE_CURRENT_BINARY_DIR "/case.json"); - load({{"file", CMAKE_CURRENT_BINARY_DIR "/case.json"}}); + remove(CMAKE_CURRENT_BINARY_DIR "/issue-642.json"); + load({{"file", CMAKE_CURRENT_BINARY_DIR "/issue-642.json"}}); plugin_->handle_message(irccd_, { server_, "JeaN!JeaN@localhost", "#history", "hello" });
--- a/tests/src/plugins/joke/CMakeLists.txt Wed Jul 25 21:41:00 2018 +0200 +++ b/tests/src/plugins/joke/CMakeLists.txt Wed Jul 25 22:02:00 2018 +0200 @@ -19,12 +19,12 @@ irccd_define_test( NAME plugin-joke SOURCES + error-empty.json + error-invalid.json + error-not-array.json + error-toobig.json + jokes.json main.cpp - jokes-empty.json - jokes-invalid.json - jokes.json - jokes-not-array.json - jokes-toobig.json LIBRARIES libirccd FLAGS PLUGIN_PATH="${CMAKE_SOURCE_DIR}/plugins/joke/joke.js" )
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/src/plugins/joke/error-empty.json Wed Jul 25 22:02:00 2018 +0200 @@ -0,0 +1,9 @@ +[ + [ + ], + [ + ], + [ + false + ] +]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/src/plugins/joke/error-invalid.json Wed Jul 25 22:02:00 2018 +0200 @@ -0,0 +1,12 @@ +[ + [ + ], + [ + 1234, + true, + "still hav a string though" + ], + [ + "a" + ] +]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/src/plugins/joke/error-not-array.json Wed Jul 25 22:02:00 2018 +0200 @@ -0,0 +1,3 @@ +{ + "reason": "this is not a valid jokes database" +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/src/plugins/joke/error-toobig.json Wed Jul 25 22:02:00 2018 +0200 @@ -0,0 +1,15 @@ +[ + [ + "xxx", + "xxx", + "xxx" + ], + [ + "a" + ], + [ + "yyy", + "yyy", + "yyy" + ] +]
--- a/tests/src/plugins/joke/jokes-empty.json Wed Jul 25 21:41:00 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -[ - [ - ], - [ - ], - [ - false - ] -]
--- a/tests/src/plugins/joke/jokes-invalid.json Wed Jul 25 21:41:00 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -[ - [ - ], - [ - 1234, - true, - "still hav a string though" - ], - [ - "a" - ] -]
--- a/tests/src/plugins/joke/jokes-not-array.json Wed Jul 25 21:41:00 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -{ - "reason": "this is not a valid jokes database" -}
--- a/tests/src/plugins/joke/jokes-toobig.json Wed Jul 25 21:41:00 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -[ - [ - "xxx", - "xxx", - "xxx" - ], - [ - "a" - ], - [ - "yyy", - "yyy", - "yyy" - ] -]
--- a/tests/src/plugins/joke/main.cpp Wed Jul 25 21:41:00 2018 +0200 +++ b/tests/src/plugins/joke/main.cpp Wed Jul 25 22:02:00 2018 +0200 @@ -98,7 +98,7 @@ { // xxx and yyy are both 3-lines which we disallow. only a must be said. load({ - { "file", CMAKE_CURRENT_SOURCE_DIR "/jokes-toobig.json" }, + { "file", CMAKE_CURRENT_SOURCE_DIR "/error-toobig.json" }, { "max-list-lines", "2" } }); @@ -130,7 +130,7 @@ { // Only a is the valid joke in this file. load({ - { "file", CMAKE_CURRENT_SOURCE_DIR "/jokes-invalid.json" }, + { "file", CMAKE_CURRENT_SOURCE_DIR "/error-invalid.json" }, }); std::unordered_map<std::string, int> said{ @@ -173,7 +173,7 @@ BOOST_AUTO_TEST_CASE(not_array) { - load({{"file", CMAKE_CURRENT_SOURCE_DIR "/jokes-not-array.json"}}); + load({{"file", CMAKE_CURRENT_SOURCE_DIR "/error-not-array.json"}}); plugin_->handle_command(irccd_, { server_, "jean!jean@localhost", "#joke", "" }); @@ -185,7 +185,7 @@ BOOST_AUTO_TEST_CASE(empty) { - load({{"file", CMAKE_CURRENT_SOURCE_DIR "/jokes-empty.json"}}); + load({{"file", CMAKE_CURRENT_SOURCE_DIR "/error-empty.json"}}); plugin_->handle_command(irccd_, {server_, "jean!jean@localhost", "#joke", ""});