diff options
Diffstat (limited to 'hyprtester/src/tests/main/scroll.cpp')
| -rw-r--r-- | hyprtester/src/tests/main/scroll.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/hyprtester/src/tests/main/scroll.cpp b/hyprtester/src/tests/main/scroll.cpp index 8bb950dd..3662f965 100644 --- a/hyprtester/src/tests/main/scroll.cpp +++ b/hyprtester/src/tests/main/scroll.cpp @@ -198,6 +198,34 @@ static void testSwapcolWrapping() { Tests::killAllWindows(); } +static bool testWindowRule() { + NLog::log("{}Testing Scrolling Width", Colors::GREEN); + + // inject a new rule. + OK(getFromSocket("/keyword windowrule[scrolling-width]:match:class kitty_scroll")); + OK(getFromSocket("/keyword windowrule[scrolling-width]:scrolling_width 0.1")); + + if (!Tests::spawnKitty("kitty_scroll")) { + NLog::log("{}Failed to spawn kitty with win class `kitty_scroll`", Colors::RED); + return false; + } + + if (!Tests::spawnKitty("kitty_scroll")) { + NLog::log("{}Failed to spawn kitty with win class `kitty_scroll`", Colors::RED); + return false; + } + + EXPECT(Tests::windowCount(), 2); + + // not the greatest test, but as long as res and gaps don't change, we good. + EXPECT_CONTAINS(getFromSocket("/activewindow"), "size: 174,1036"); + + NLog::log("{}Killing all windows", Colors::YELLOW); + Tests::killAllWindows(); + EXPECT(Tests::windowCount(), 0); + return true; +} + static bool test() { NLog::log("{}Testing Scroll layout", Colors::GREEN); @@ -217,6 +245,8 @@ static bool test() { NLog::log("{}Testing swapcol wrap", Colors::GREEN); testSwapcolWrapping(); + testWindowRule(); + // clean up NLog::log("Cleaning up", Colors::YELLOW); OK(getFromSocket("/dispatch workspace 1")); |
