diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2026-04-26 15:16:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-26 15:16:36 +0100 |
| commit | 5ba33f846129f3e6c0505b19f94634b24505e828 (patch) | |
| tree | aaacabe678006040c342935481a86607c66607fd /hyprtester/src/tests/main/groups.cpp | |
| parent | 329b2b356dd92ac07f4e2aa69cbce82ee9ba9d19 (diff) | |
config/lua: init lua config manager, use lua if available (#13817)
Adds a new lua config manager, which will automatically be used if there is a lua config present.
Diffstat (limited to 'hyprtester/src/tests/main/groups.cpp')
| -rw-r--r-- | hyprtester/src/tests/main/groups.cpp | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/hyprtester/src/tests/main/groups.cpp b/hyprtester/src/tests/main/groups.cpp index 86ffc7f7..71b5cf18 100644 --- a/hyprtester/src/tests/main/groups.cpp +++ b/hyprtester/src/tests/main/groups.cpp @@ -23,7 +23,7 @@ static bool test() { // test on workspace "window" NLog::log("{}Dispatching workspace `groups`", Colors::YELLOW); - getFromSocket("/dispatch workspace name:groups"); + getFromSocket("/dispatch hl.dsp.focus({ workspace = 'name:groups' })"); NLog::log("{}Testing movewindoworgroup from group to group", Colors::YELLOW); auto kittyA = Tests::spawnKitty("kittyA"); @@ -47,10 +47,10 @@ static bool test() { return false; } - OK(getFromSocket("/dispatch focuswindow class:kittyB")); - OK(getFromSocket("/dispatch togglegroup")); - OK(getFromSocket("/dispatch focuswindow class:kittyA")); - OK(getFromSocket("/dispatch togglegroup")); + OK(getFromSocket("/dispatch hl.dsp.focus({ window = 'class:kittyB' })")); + OK(getFromSocket("/dispatch hl.dsp.group.toggle()")); + OK(getFromSocket("/dispatch hl.dsp.focus({ window = 'class:kittyA' })")); + OK(getFromSocket("/dispatch hl.dsp.group.toggle()")); NLog::log("{}Check kittyB dimensions", Colors::YELLOW); { @@ -72,7 +72,7 @@ static bool test() { EXPECT_COUNT_STRING(str, "fullscreen: 0", 1); } - OK(getFromSocket("/dispatch movewindoworgroup r")); + OK(getFromSocket("/dispatch hl.dsp.window.move({ direction = 'right', group_aware = true })")); NLog::log("{}Check that dimensions remain the same after move", Colors::YELLOW); { auto str = getFromSocket("/activewindow"); @@ -105,8 +105,8 @@ static bool test() { // group the kitty NLog::log("{}Enable group and groupbar", Colors::YELLOW); - OK(getFromSocket("/dispatch togglegroup")); - OK(getFromSocket("/keyword group:groupbar:enabled 1")); + OK(getFromSocket("/dispatch hl.dsp.group.toggle()")); + OK(getFromSocket("/eval hl.config({ group = { groupbar = { enabled = 1 } } })")); // check the height of the window now NLog::log("{}Recheck kitty dimensions", Colors::YELLOW); @@ -118,7 +118,7 @@ static bool test() { // disable the groupbar for ease of testing for now NLog::log("{}Disable groupbar", Colors::YELLOW); - OK(getFromSocket("r/keyword group:groupbar:enabled 0")); + OK(getFromSocket("r/eval hl.config({ group = { groupbar = { enabled = 0 } } })")); // kill all NLog::log("{}Kill windows", Colors::YELLOW); @@ -132,7 +132,7 @@ static bool test() { } NLog::log("{}Group kitty", Colors::YELLOW); - OK(getFromSocket("/dispatch togglegroup")); + OK(getFromSocket("/dispatch hl.dsp.group.toggle()")); // check the height of the window now NLog::log("{}Check kitty dimensions 2", Colors::YELLOW); @@ -166,7 +166,7 @@ static bool test() { // test cycling through NLog::log("{}Test cycling through grouped windows", Colors::YELLOW); - OK(getFromSocket("/dispatch changegroupactive f")); + OK(getFromSocket("/dispatch hl.dsp.group.next()")); try { auto str = getFromSocket("/activewindow"); @@ -176,7 +176,7 @@ static bool test() { ret = 1; } - getFromSocket("/dispatch changegroupactive f"); + getFromSocket("/dispatch hl.dsp.group.next()"); try { auto str = getFromSocket("/activewindow"); @@ -191,7 +191,7 @@ static bool test() { try { auto str = getFromSocket("/activewindow"); auto activeBeforeMove = std::stoull(str.substr(7, str.find(" -> ") - 7), nullptr, 16); - OK(getFromSocket("/dispatch movegroupwindow f")); + OK(getFromSocket("/dispatch hl.dsp.group.move_window({ forward = true })")); str = getFromSocket("/activewindow"); auto activeAfterMove = std::stoull(str.substr(7, str.find(" -> ") - 7), nullptr, 16); EXPECT(activeAfterMove, activeBeforeMove); @@ -205,7 +205,7 @@ static bool test() { try { auto str = getFromSocket("/activewindow"); auto activeBeforeMove = std::stoull(str.substr(7, str.find(" -> ") - 7), nullptr, 16); - OK(getFromSocket("/dispatch movegroupwindow b")); + OK(getFromSocket("/dispatch hl.dsp.group.move_window({ forward = false })")); str = getFromSocket("/activewindow"); auto activeAfterMove = std::stoull(str.substr(7, str.find(" -> ") - 7), nullptr, 16); EXPECT(activeAfterMove, activeBeforeMove); @@ -215,7 +215,7 @@ static bool test() { } NLog::log("{}Disable autogrouping", Colors::YELLOW); - OK(getFromSocket("/keyword group:auto_group false")); + OK(getFromSocket("/eval hl.config({ group = { auto_group = false } })")); NLog::log("{}Spawn kittyProcC", Colors::YELLOW); auto kittyProcC = Tests::spawnKitty(); @@ -231,10 +231,10 @@ static bool test() { EXPECT_COUNT_STRING(str, "at: 22,22", 2); } - OK(getFromSocket("/dispatch movefocus l")); - OK(getFromSocket("/dispatch changegroupactive 1")); - OK(getFromSocket("/keyword group:auto_group true")); - OK(getFromSocket("/keyword group:insert_after_current false")); + OK(getFromSocket("/dispatch hl.dsp.focus({ direction = 'left' })")); + OK(getFromSocket("/dispatch hl.dsp.group.active({ index = 1 })")); + OK(getFromSocket("/eval hl.config({ group = { auto_group = true } })")); + OK(getFromSocket("/eval hl.config({ group = { insert_after_current = false } })")); NLog::log("{}Spawn kittyProcD", Colors::YELLOW); auto kittyProcD = Tests::spawnKitty(); @@ -246,7 +246,7 @@ static bool test() { NLog::log("{}Expecting 4 windows", Colors::YELLOW); EXPECT(Tests::windowCount(), 4); - OK(getFromSocket("/dispatch changegroupactive 3")); + OK(getFromSocket("/dispatch hl.dsp.group.active({ index = 3 })")); { auto str = getFromSocket("/activewindow"); @@ -262,7 +262,7 @@ static bool test() { // test movewindoworgroup: direction should be respected when extracting from group NLog::log("{}Test movewindoworgroup respects direction out of group", Colors::YELLOW); - OK(getFromSocket("/keyword group:groupbar:enabled 0")); + OK(getFromSocket("/eval hl.config({ group = { groupbar = { enabled = 0 } } })")); { auto kittyE = Tests::spawnKitty(); if (!kittyE) { @@ -271,7 +271,7 @@ static bool test() { } // group kitty, and new windows should be auto-grouped - OK(getFromSocket("/dispatch togglegroup")); + OK(getFromSocket("/dispatch hl.dsp.group.toggle()")); auto kittyF = Tests::spawnKitty(); if (!kittyF) { @@ -288,7 +288,7 @@ static bool test() { // move active window out of group to the right NLog::log("{}Test movewindoworgroup r", Colors::YELLOW); - OK(getFromSocket("/dispatch movewindoworgroup r")); + OK(getFromSocket("/dispatch hl.dsp.window.move({ direction = 'right', group_aware = true })")); // the group should stay at x=22, the extracted window should be to the right { @@ -297,11 +297,11 @@ static bool test() { } // move it back into the group - OK(getFromSocket("/dispatch moveintogroup l")); + OK(getFromSocket("/dispatch hl.dsp.window.move({ into_group = 'left' })")); // move active window out of group downward NLog::log("{}Test movewindoworgroup d", Colors::YELLOW); - OK(getFromSocket("/dispatch movewindoworgroup d")); + OK(getFromSocket("/dispatch hl.dsp.window.move({ direction = 'down', group_aware = true })")); // the group should stay at y=22, the extracted window should be below { @@ -316,17 +316,17 @@ static bool test() { // test that we deny a floated window getting auto-grouped into a tiled group. NLog::log("{}Test that we deny a floated window getting auto-grouped into a tiled group.", Colors::GREEN); - OK(getFromSocket("/keyword windowrule[kitty-tiled]:match:class kitty_tiled")); - OK(getFromSocket("/keyword windowrule[kitty-tiled]:tile yes")); + OK(getFromSocket("/eval hl.window_rule({ name = 'kitty-tiled', match = { class = 'kitty_tiled' } })")); + OK(getFromSocket("/eval hl.window_rule({ name = 'kitty-tiled', tile = true })")); auto kittyProcE = Tests::spawnKitty("kitty_tiled"); if (!kittyProcE) { NLog::log("{}Error: kitty did not spawn", Colors::RED); return false; } - OK(getFromSocket("/dispatch togglegroup")); + OK(getFromSocket("/dispatch hl.dsp.group.toggle()")); - OK(getFromSocket("/keyword windowrule[kitty-floated]:match:class kitty_floated")); - OK(getFromSocket("/keyword windowrule[kitty-floated]:float yes")); + OK(getFromSocket("/eval hl.window_rule({ name = 'kitty-floated', match = { class = 'kitty_floated' } })")); + OK(getFromSocket("/eval hl.window_rule({ name = 'kitty-floated', float = true })")); auto kittyProcF = Tests::spawnKitty("kitty_floated"); if (!kittyProcF) { NLog::log("{}Error: kitty did not spawn", Colors::RED); @@ -366,7 +366,7 @@ static bool test() { NLog::log("{}Error: unlocked kitty did not spawn", Colors::RED); return false; } - OK(getFromSocket("/dispatch togglegroup")); + OK(getFromSocket("/dispatch hl.dsp.group.toggle()")); auto winB = Tests::spawnKitty("top"); if (!winB) { @@ -391,9 +391,9 @@ static bool test() { NLog::log("{}Error: locked kitty did not spawn", Colors::RED); return false; } - OK(getFromSocket("/dispatch togglegroup")); - OK(getFromSocket(std::format("/dispatch focuswindow pid:{}", lockedWin->pid()))); - OK(getFromSocket("/dispatch lockactivegroup lock")); + OK(getFromSocket("/dispatch hl.dsp.group.toggle()")); + OK(getFromSocket(std::format("/dispatch hl.dsp.focus({{ window = 'pid:{}' }})", lockedWin->pid()))); + OK(getFromSocket("/dispatch hl.dsp.group.lock_active({ action = 'set' })")); auto winB = Tests::spawnKitty("top"); if (!winB) { @@ -413,8 +413,8 @@ static bool test() { // Test locked groups WITH invade rule { - OK(getFromSocket("/keyword windowrule[locked-im]:match:class ^locked|invade$")); - OK(getFromSocket("/keyword windowrule[locked-im]:group set always lock invade")); + OK(getFromSocket("/eval hl.window_rule({ name = 'locked-im', match = { class = '^locked|invade$' } })")); + OK(getFromSocket("/eval hl.window_rule({ name = 'locked-im', group = 'set always lock invade' })")); auto lockedWin = Tests::spawnKitty("locked"); if (!lockedWin) { |
