From c84f02f7411c3825d6ae6b19b094f73e7eacdc31 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 15 Mar 2024 00:53:58 +0000 Subject: [PATCH] feat: add initial commands --- main.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/main.cpp b/main.cpp index 77d35cd..5a9d21f 100644 --- a/main.cpp +++ b/main.cpp @@ -2,9 +2,24 @@ #include "CalculatorCli.hpp" +constexpr std::array kInitialCommands{ + std::string_view{"a = 2 + 3"}, + std::string_view{"b = e - 2"}, + std::string_view{"c = 1 + 2"}, + std::string_view{"d = e / 3"}, + std::string_view{"e = a + c"}, + std::string_view{"f = 3 + 4"}, + std::string_view{"undo 2"}, + std::string_view{"e = 2 + 2"}, + std::string_view{"f = g * 7"}, +}; + auto main() -> int { CalculatorCli cli; + for (const auto commands : kInitialCommands) { + cli.parse(commands); + } cli.runLoop(); return 0; }