|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307 |
- #include <map>
- #include <string>
- #include <vector>
- #include "llm.h"
- #include "memory_Context.h"
- #include "main.h"
-
- std::string cli_test_exit_e(
- ) {
- auto c = memory_createContext();
- c.input = "e";
- c.recentField = "input";
- c = cli_exit(c);
- if (
- c.recentField == "exit"
- ) {
- return "OK: cli_exit_e";
- }
- return "ERR: cli_exit_e";
- }
-
- std::string cli_test_exit_exit(
- ) {
- auto c = memory_createContext();
- c.input = "exit";
- c.recentField = "input";
- c = cli_exit(c);
- if (
- c.recentField == "exit"
- ) {
- return "OK: cli_exit_exit";
- }
- return "ERR: cli_exit_e";
- }
-
-
-
-
- std::string cli_test_exit_victory(
- ) {
- auto c = memory_createContext();
- c.playfieldSize = 2;
- c.recentField = "playfieldSize";
- c = memory_generateConstPlayfield(c);
- // Match the first pair of tiles.
- c.input = "1";
- c.recentField = "input";
- c = cli_selectItem(c);
- c = memory_selectItem(c);
- c.input = "2";
- c.recentField = "input";
- c = cli_selectItem(c);
- c = memory_selectItem(c);
- c = memory_hideMatchingItems(c);
- // Match the second pair of tiles.
- c.input = "3";
- c.recentField = "input";
- c = cli_selectItem(c);
- c = memory_selectItem(c);
- c.input = "4";
- c.recentField = "input";
- c = cli_selectItem(c);
- c = memory_selectItem(c);
- c = memory_hideMatchingItems(c);
- c = memory_detectVictory(c);
- c = cli_reportVictory(c);
- c = cli_exit(c);
- if (
- c.recentField == "exit"
- ) {
- return "OK: cli_exit_victory";
- }
- return "ERR: cli_exit_victory";
- }
-
- std::string cli_test_exit_q(
- ) {
- auto c = memory_createContext();
- c.input = "q";
- c.recentField = "input";
- c = cli_exit(c);
- if (
- c.recentField == "exit"
- ) {
- return "OK: cli_exit_q";
- }
- return "ERR: cli_exit_q";
- }
-
- std::string cli_test_exit_quit(
- ) {
- auto c = memory_createContext();
- c.input = "quit";
- c.recentField = "input";
- c = cli_exit(c);
- if (
- c.recentField == "exit"
- ) {
- return "OK: cli_exit_quit";
- }
- return "ERR: cli_exit_quit";
- }
-
-
-
- std::string cli_test_goOn(
- ) {
- auto c = memory_createContext();
- c.playfieldSize = 2;
- c.recentField = "playfieldSize";
- c = memory_generateConstPlayfield(c);
- // Match the first pair of items.
- c.input = "1";
- c.recentField = "input";
- c = cli_selectItem(c);
- c = memory_selectItem(c);
- c.input = "2";
- c.recentField = "input";
- c = cli_selectItem(c);
- c = memory_selectItem(c);
- c = memory_hideMatchingItems(c);
- c = cli_reportMatchedItems(c);
- c = cli_goOn(c);
- if (
- c.recentField == "outputGoOn"
- ) {
- return "OK: cli_goOn";
- }
- return "ERR: cli_goOn";
- }
-
- std::string cli_test_greetUser(
- ) {
- auto c = memory_createContext();
- c.didLaunch = true;
- c.recentField = "didLaunch";
- c = cli_greetUser(c);
- if (
- c.recentField == "outputGreeting"
- ) {
- return "OK: cli_greetUser";
- }
- return "ERR: cli_greetUser";
- }
-
- std::string cli_test_promptSecondItemSelection(
- ) {
- auto c = memory_createContext();
- c.input = "1";
- c.recentField = "input";
- c = cli_selectItem(c);
- c = memory_selectItem(c);
- c = cli_promptSecondItemSelection(c);
- if (
- c.recentField == "outputPromptSelection"
- ) {
- return "OK: cli_promptSecondItemSelection";
- }
- return "ERR: cli_promptSecondItemSelection";
- }
-
- std::string cli_test_reportMatchedItems(
- ) {
- auto c = memory_createContext();
- c.playfieldSize = 2;
- c.recentField = "playfieldSize";
- c = memory_generateConstPlayfield(c);
- c.input = "1";
- c.recentField = "input";
- c = cli_selectItem(c);
- c = memory_selectItem(c);
- c.input = "2";
- c.recentField = "input";
- c = cli_selectItem(c);
- c = memory_selectItem(c);
- c = memory_hideMatchingItems(c);
- c = cli_reportMatchedItems(c);
- if (
- c.recentField == "outputMatchedItems"
- ) {
- return "OK: cli_reportMatchedItems";
- }
- return "ERR: cli_reportMatchedItems";
- }
-
- std::string cli_test_reportMismatchedItems(
- ) {
- auto c = memory_createContext();
- c.playfieldSize = 2;
- c.recentField = "playfieldSize";
- c = memory_generateConstPlayfield(c);
- c.input = "1";
- c.recentField = "input";
- c = cli_selectItem(c);
- c = memory_selectItem(c);
- c.input = "3";
- c.recentField = "input";
- c = cli_selectItem(c);
- c = memory_selectItem(c);
- c = memory_detectMismatchedItems(c);
- c = cli_reportMismatchedItems(c);
- if (
- c.recentField == "outputMismatchedItems"
- ) {
- return "OK: cli_reportMismatchedItems";
- }
- return "ERR: cli_reportMismatchedItems";
- }
-
- std::string cli_test_selectItem(
- ) {
- auto c = memory_createContext();
- c.input = "1";
- c.recentField = "input";
- c = cli_selectItem(c);
- if (
- c.recentField == "selectedId" &&
- c.selectedId == 0
- ) {
- return "OK: cli_selectItem";
- }
- return "ERR: cli_selectItem";
- }
-
- std::string cli_test_showHelp_h(
- ) {
- auto c = memory_createContext();
- c.input = "h";
- c.recentField = "input";
- c = cli_showHelp(c);
- if (
- c.recentField == "outputHelp"
- ) {
- return "OK: cli_showHelp_h";
- }
- return "ERR: cli_showHelp_h";
- }
-
- std::string cli_test_showHelp_help(
- ) {
- auto c = memory_createContext();
- c.input = "help";
- c.recentField = "input";
- c = cli_showHelp(c);
- if (
- c.recentField == "outputHelp"
- ) {
- return "OK: cli_showHelp_help";
- }
- return "ERR: cli_showHelp_help";
- }
-
-
-
-
- std::string cli_test_reportVictory(
- ) {
- auto c = memory_createContext();
- c.playfieldSize = 2;
- c.recentField = "playfieldSize";
- c = memory_generateConstPlayfield(c);
- // Match the first pair of tiles.
- c.input = "1";
- c.recentField = "input";
- c = cli_selectItem(c);
- c = memory_selectItem(c);
- c.input = "2";
- c.recentField = "input";
- c = cli_selectItem(c);
- c = memory_selectItem(c);
- c = memory_hideMatchingItems(c);
- // Match the second pair of tiles.
- c.input = "3";
- c.recentField = "input";
- c = cli_selectItem(c);
- c = memory_selectItem(c);
- c.input = "4";
- c.recentField = "input";
- c = cli_selectItem(c);
- c = memory_selectItem(c);
- c = memory_hideMatchingItems(c);
- c = memory_detectVictory(c);
- c = cli_reportVictory(c);
- if (
- c.recentField == "outputVictory"
- ) {
- return "OK: cli_reportVictory";
- }
- return "ERR: cli_reportVictory";
- }
-
- //def cli_test_shouldReportIvalidItemSelection_outOfBoundsMin(
- //) -> str:
- // c = cli_createContext()
- // c.cMemory = memory_createContext()
- // c.input = "0"
- // c = cli_selectItem(c)
- // c = cli_shouldReportInvalidItemSelection(c)
- // if (
- // c.recentField == "outputInvalidItemSelection"
- // ):
- // return "OK: cli_shouldReportInvalidItemSelection"
- // //}
- // return "ERR: cli_shouldReportInvalidItemSelection"
- ////}
- //
-
|