diff options
| author | ItsOhen <TNordfeldt@gmail.com> | 2025-09-27 01:04:22 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-27 01:04:22 +0200 |
| commit | 6f1d2e771dca1b5eea5ec344ca1b6a80d4fd4ee5 (patch) | |
| tree | 05ad285d904fd074897b3a53bf4b364fc3afb1e3 /hyprtester/src/tests/main/window.cpp | |
| parent | ae445606e26020225e50d71e8ffd5282f68a9961 (diff) | |
config: fix rules with no parameters not being counted as invalid (#11849)
Quite a big whoopsie to insert invalid rules.
Also adds special: cases.
Diffstat (limited to 'hyprtester/src/tests/main/window.cpp')
| -rw-r--r-- | hyprtester/src/tests/main/window.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/hyprtester/src/tests/main/window.cpp b/hyprtester/src/tests/main/window.cpp index 4645a26c..9880997e 100644 --- a/hyprtester/src/tests/main/window.cpp +++ b/hyprtester/src/tests/main/window.cpp @@ -237,7 +237,30 @@ static bool test() { EXPECT_CONTAINS(str, "floating: 1"); EXPECT_CONTAINS(str, std::format("size: {},{}", SIZE, SIZE)); EXPECT_NOT_CONTAINS(str, "pinned: 1"); + + OK(getFromSocket("/keyword windowrule plugin:someplugin:variable, class:wr_kitty")); + OK(getFromSocket("/keyword windowrule plugin:someplugin:variable 10, class:wr_kitty")); + OK(getFromSocket("/keyword windowrule workspace 1, class:wr_kitty")); + OK(getFromSocket("/keyword windowrule workspace special:magic, class:magic_kitty")); + + if (!spawnKitty("magic_kitty")) + return false; + EXPECT_CONTAINS(getFromSocket("/activewindow"), "special:magic"); } + NLog::log("{}Testing faulty rules", Colors::YELLOW); + { + const auto PARAM = "Invalid parameter"; + const auto RULE = "Invalid value"; + const auto NORULE = "no rules provided"; + EXPECT_CONTAINS(getFromSocket("/keyword windowrule notarule, class:wr_kitty"), RULE) + EXPECT_CONTAINS(getFromSocket("/keyword windowrule class:wr_kitty"), NORULE) + EXPECT_CONTAINS(getFromSocket("/keyword windowrule float, class:wr_kitty, size"), PARAM) + EXPECT_CONTAINS(getFromSocket("/keyword windowrule float, classI:wr_kitty"), PARAM) + EXPECT_CONTAINS(getFromSocket("/keyword windowrule workspace:, class:wr_kitty"), NORULE) + } + + NLog::log("{}Reloading config", Colors::YELLOW); + OK(getFromSocket("/reload")); NLog::log("{}Killing all windows", Colors::YELLOW); Tests::killAllWindows(); |
