diff --git a/src/proc/control/command-impl.hpp b/src/proc/control/command-impl.hpp index 672a8400b..a316c0bf2 100644 --- a/src/proc/control/command-impl.hpp +++ b/src/proc/control/command-impl.hpp @@ -47,6 +47,7 @@ #include "proc/control/command-mutation.hpp" #include "lib/typed-allocation-manager.hpp" #include "lib/bool-checkable.hpp" +#include "lib/format-string.hpp" #include #include @@ -58,6 +59,7 @@ namespace proc { namespace control { + using util::_Fmt; using std::function; using std::shared_ptr; @@ -219,6 +221,15 @@ namespace control { return isValid() && pClo_->isCaptured(); } + operator string() const + { + return _Fmt("Cmd|valid:%s, exec:%s, undo:%s |%s") + % isValid() + % canExec() + % canUndo() + % (pClo_? string(*pClo_) : util::FAILURE_INDICATOR); + } + friend bool diff --git a/tests/gui/test/test-nexus.cpp b/tests/gui/test/test-nexus.cpp index d9b9bbbff..45a266c38 100644 --- a/tests/gui/test/test-nexus.cpp +++ b/tests/gui/test/test-nexus.cpp @@ -449,7 +449,7 @@ namespace test{ void performExec (CommandImpl& command) const override { - log_.call ("TestNexus", "exec"); + log_.call ("MockHandlingPattern", "exec", command); command.invokeCapture(); command.invokeOperation(); } @@ -457,7 +457,7 @@ namespace test{ void performUndo (CommandImpl& command) const override { - log_.call ("TestNexus", "undo"); + log_.call ("MockHandlingPattern", "undo", command); command.invokeUndo(); }