Research portable Memory game | Исследовать портируемую игру Память
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cli_test.cpp 842B

6 months ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #include <map>
  2. #include <string>
  3. #include <vector>
  4. #include "cli.h"
  5. #include "cli_Context.h"
  6. #include "memory.h"
  7. #include "memory_Context.h"
  8. #include "shell.h"
  9. std::string cli_test_greetUser(
  10. ) {
  11. auto c = cli_createContext();
  12. c = cli_greetUser(c);
  13. if (
  14. c.recentField == "outputGreeting"
  15. ) {
  16. return "OK: cli_greetUser";
  17. }
  18. return "ERR: cli_greetUser";
  19. }
  20. std::string cli_test_showHelp_h(
  21. ) {
  22. auto c = cli_createContext();
  23. c.input = "h";
  24. c = cli_showHelp(c);
  25. if (
  26. c.recentField == "outputHelp"
  27. ) {
  28. return "OK: cli_showHelp_h";
  29. }
  30. return "ERR: cli_showHelp_h";
  31. }
  32. std::string cli_test_showHelp_help(
  33. ) {
  34. auto c = cli_createContext();
  35. c.input = "help";
  36. c = cli_showHelp(c);
  37. if (
  38. c.recentField == "outputHelp"
  39. ) {
  40. return "OK: cli_showHelp_help";
  41. }
  42. return "ERR: cli_showHelp_help";
  43. }