diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2026-02-28 18:53:36 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-28 18:53:36 +0000 |
| commit | f12904e641ae6dbdce4555c0c583cb7fbe9c5b06 (patch) | |
| tree | 368681fa06130186a2b34ce997128b91e7c6ea3c /hyprtester | |
| parent | b90c61c04f02ae5bbf0d1a1a63da18f3cee6919d (diff) | |
layout/algo: fix swar on removing a target (#13427)
ref https://github.com/hyprwm/Hyprland/discussions/13422
Diffstat (limited to 'hyprtester')
| -rw-r--r-- | hyprtester/src/tests/main/layout.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/hyprtester/src/tests/main/layout.cpp b/hyprtester/src/tests/main/layout.cpp new file mode 100644 index 00000000..c0587f25 --- /dev/null +++ b/hyprtester/src/tests/main/layout.cpp @@ -0,0 +1,54 @@ +#include "../shared.hpp" +#include "../../shared.hpp" +#include "../../hyprctlCompat.hpp" +#include "tests.hpp" + +static int ret = 0; + +static void swar() { + OK(getFromSocket("/keyword layout:single_window_aspect_ratio 1 1")); + + Tests::spawnKitty(); + + { + auto str = getFromSocket("/activewindow"); + EXPECT_CONTAINS(str, "at: 442,22"); + EXPECT_CONTAINS(str, "size: 1036,1036"); + } + + Tests::spawnKitty(); + + OK(getFromSocket("/dispatch killwindow activewindow")); + + Tests::waitUntilWindowsN(1); + + { + auto str = getFromSocket("/activewindow"); + EXPECT_CONTAINS(str, "at: 442,22"); + EXPECT_CONTAINS(str, "size: 1036,1036"); + } + + // clean up + NLog::log("{}Killing all windows", Colors::YELLOW); + Tests::killAllWindows(); +} + +static bool test() { + NLog::log("{}Testing layout generic", Colors::GREEN); + + // setup + OK(getFromSocket("/dispatch workspace 10")); + + // test + NLog::log("{}Testing `single_window_aspect_ratio`", Colors::GREEN); + swar(); + + // clean up + NLog::log("Cleaning up", Colors::YELLOW); + OK(getFromSocket("/dispatch workspace 1")); + OK(getFromSocket("/reload")); + + return !ret; +} + +REGISTER_TEST_FN(test); |
