summaryrefslogtreecommitdiff
path: root/hyprtester/src/tests/main/snap.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2026-04-26 15:16:36 +0100
committerGitHub <noreply@github.com>2026-04-26 15:16:36 +0100
commit5ba33f846129f3e6c0505b19f94634b24505e828 (patch)
treeaaacabe678006040c342935481a86607c66607fd /hyprtester/src/tests/main/snap.cpp
parent329b2b356dd92ac07f4e2aa69cbce82ee9ba9d19 (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/snap.cpp')
-rw-r--r--hyprtester/src/tests/main/snap.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/hyprtester/src/tests/main/snap.cpp b/hyprtester/src/tests/main/snap.cpp
index 9c25de11..ca103fa0 100644
--- a/hyprtester/src/tests/main/snap.cpp
+++ b/hyprtester/src/tests/main/snap.cpp
@@ -16,8 +16,8 @@ static bool spawnFloatingKitty() {
NLog::log("{}Error: kitty did not spawn", Colors::RED);
return false;
}
- OK(getFromSocket("/dispatch setfloating active"));
- OK(getFromSocket("/dispatch resizeactive exact 100 100"));
+ OK(getFromSocket("/dispatch hl.dsp.window.float({ action = 'set' })"));
+ OK(getFromSocket("/dispatch hl.dsp.window.resize({ x = 100, y = 100 })"));
return true;
}
@@ -40,8 +40,8 @@ static void expectSnapMove(const Vector2D FROM, const Vector2D* TO) {
else
NLog::log("{}Expecting no snap when window is moved to ({},{})", Colors::YELLOW, A.x, A.y);
- expectSocket(std::format("/dispatch moveactive exact {} {}", A.x, A.y));
- expectSocket("/dispatch plugin:test:snapmove");
+ expectSocket(std::format("/dispatch hl.dsp.window.move({{ x = {}, y = {} }})", A.x, A.y));
+ expectSocket("/eval hl.plugin.test.snapmove()");
EXPECT_CONTAINS(getFromSocket("/activewindow"), std::format("at: {},{}", B.x, B.y));
}
@@ -114,13 +114,13 @@ static bool test() {
// move to monitor HEADLESS-2
NLog::log("{}Moving to monitor HEADLESS-2", Colors::YELLOW);
- OK(getFromSocket("/dispatch focusmonitor HEADLESS-2"));
+ OK(getFromSocket("/dispatch hl.dsp.focus({ monitor = 'HEADLESS-2' })"));
NLog::log("{}Adding reserved monitor area to HEADLESS-2", Colors::YELLOW);
- OK(getFromSocket("/keyword monitor HEADLESS-2,addreserved,200,200,200,200"));
+ OK(getFromSocket("/eval hl.monitor({ output = 'HEADLESS-2', reserved = { top = 200, right = 200, bottom = 200, left = 200 } })"));
// test on workspace "snap"
NLog::log("{}Dispatching workspace `snap`", Colors::YELLOW);
- OK(getFromSocket("/dispatch workspace name:snap"));
+ OK(getFromSocket("/dispatch hl.dsp.focus({ workspace = 'name:snap' })"));
// spawn a kitty terminal and move to (500,500)
NLog::log("{}Spawning kittyProcA", Colors::YELLOW);
@@ -131,7 +131,7 @@ static bool test() {
EXPECT(Tests::windowCount(), 1);
NLog::log("{}Move the kitty window to (500,500)", Colors::YELLOW);
- OK(getFromSocket("/dispatch moveactive exact 500 500"));
+ OK(getFromSocket("/dispatch hl.dsp.window.move({ x = 500, y = 500 })"));
// spawn a second kitty terminal
NLog::log("{}Spawning kittyProcB", Colors::YELLOW);
@@ -146,17 +146,17 @@ static bool test() {
testMonitorSnap(false, false);
NLog::log("\n{}Turning on respect_gaps", Colors::YELLOW);
- OK(getFromSocket("/keyword general:snap:respect_gaps true"));
+ OK(getFromSocket("/eval hl.config({ general = { snap = { respect_gaps = true } } })"));
testWindowSnap(true);
testMonitorSnap(true, false);
NLog::log("\n{}Turning on border_overlap", Colors::YELLOW);
- OK(getFromSocket("/keyword general:snap:respect_gaps false"));
- OK(getFromSocket("/keyword general:snap:border_overlap true"));
+ OK(getFromSocket("/eval hl.config({ general = { snap = { respect_gaps = false } } })"));
+ OK(getFromSocket("/eval hl.config({ general = { snap = { border_overlap = true } } })"));
testMonitorSnap(false, true);
NLog::log("\n{}Turning on both border_overlap and respect_gaps", Colors::YELLOW);
- OK(getFromSocket("/keyword general:snap:respect_gaps true"));
+ OK(getFromSocket("/eval hl.config({ general = { snap = { respect_gaps = true } } })"));
testMonitorSnap(true, true);
// kill all
@@ -168,7 +168,7 @@ static bool test() {
NLog::log("{}Reloading the config", Colors::YELLOW);
OK(getFromSocket("/reload"));
- OK(getFromSocket("/dispatch workspace 1"));
+ OK(getFromSocket("/dispatch hl.dsp.focus({ workspace = '1' })"));
return !ret;
}