diff options
Diffstat (limited to 'hyprtester/src/tests/shared.cpp')
| -rw-r--r-- | hyprtester/src/tests/shared.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/hyprtester/src/tests/shared.cpp b/hyprtester/src/tests/shared.cpp index f6e2fce9..32824f3b 100644 --- a/hyprtester/src/tests/shared.cpp +++ b/hyprtester/src/tests/shared.cpp @@ -181,3 +181,13 @@ bool Tests::writeFile(const std::string& name, const std::string& contents) { return true; } + +std::string Tests::getWindowAttribute(const std::string& winInfo, const std::string& attr) { + auto pos = winInfo.find(attr); + if (pos == std::string::npos) { + NLog::log("{}Window attribute not found: '{}'", Colors::RED, attr); + return "Wrong window attribute"; + } + auto pos2 = winInfo.find('\n', pos); + return winInfo.substr(pos, pos2 - pos); +} |
