summaryrefslogtreecommitdiff
path: root/hyprtester/src/tests/main/scroll.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/scroll.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/scroll.cpp')
-rw-r--r--hyprtester/src/tests/main/scroll.cpp68
1 files changed, 34 insertions, 34 deletions
diff --git a/hyprtester/src/tests/main/scroll.cpp b/hyprtester/src/tests/main/scroll.cpp
index 3662f965..3b73b906 100644
--- a/hyprtester/src/tests/main/scroll.cpp
+++ b/hyprtester/src/tests/main/scroll.cpp
@@ -15,37 +15,37 @@ static void testFocusCycling() {
}
}
- OK(getFromSocket("/dispatch focuswindow class:a"));
+ OK(getFromSocket("/dispatch hl.dsp.focus({ window = 'class:a' })"));
- OK(getFromSocket("/dispatch movefocus r"));
+ OK(getFromSocket("/dispatch hl.dsp.focus({ direction = 'right' })"));
{
auto str = getFromSocket("/activewindow");
EXPECT_CONTAINS(str, "class: b");
}
- OK(getFromSocket("/dispatch movefocus r"));
+ OK(getFromSocket("/dispatch hl.dsp.focus({ direction = 'right' })"));
{
auto str = getFromSocket("/activewindow");
EXPECT_CONTAINS(str, "class: c");
}
- OK(getFromSocket("/dispatch movefocus r"));
+ OK(getFromSocket("/dispatch hl.dsp.focus({ direction = 'right' })"));
{
auto str = getFromSocket("/activewindow");
EXPECT_CONTAINS(str, "class: d");
}
- OK(getFromSocket("/dispatch movewindow l"));
+ OK(getFromSocket("/dispatch hl.dsp.window.move({ direction = 'left' })"));
{
auto str = getFromSocket("/activewindow");
EXPECT_CONTAINS(str, "class: d");
}
- OK(getFromSocket("/dispatch movefocus u"));
+ OK(getFromSocket("/dispatch hl.dsp.focus({ direction = 'up' })"));
{
auto str = getFromSocket("/activewindow");
@@ -68,18 +68,18 @@ static void testFocusWrapping() {
}
// set wrap_focus to true
- OK(getFromSocket("/keyword scrolling:wrap_focus true"));
+ OK(getFromSocket("/eval hl.config({ scrolling = { wrap_focus = true } })"));
- OK(getFromSocket("/dispatch focuswindow class:a"));
+ OK(getFromSocket("/dispatch hl.dsp.focus({ window = 'class:a' })"));
- OK(getFromSocket("/dispatch layoutmsg focus l"));
+ OK(getFromSocket("/dispatch hl.dsp.layout('focus l')"));
{
auto str = getFromSocket("/activewindow");
EXPECT_CONTAINS(str, "class: d");
}
- OK(getFromSocket("/dispatch layoutmsg focus r"));
+ OK(getFromSocket("/dispatch hl.dsp.layout('focus r')"));
{
auto str = getFromSocket("/activewindow");
@@ -87,20 +87,20 @@ static void testFocusWrapping() {
}
// set wrap_focus to false
- OK(getFromSocket("/keyword scrolling:wrap_focus false"));
+ OK(getFromSocket("/eval hl.config({ scrolling = { wrap_focus = false } })"));
- OK(getFromSocket("/dispatch focuswindow class:a"));
+ OK(getFromSocket("/dispatch hl.dsp.focus({ window = 'class:a' })"));
- OK(getFromSocket("/dispatch layoutmsg focus l"));
+ OK(getFromSocket("/dispatch hl.dsp.layout('focus l')"));
{
auto str = getFromSocket("/activewindow");
EXPECT_CONTAINS(str, "class: a");
}
- OK(getFromSocket("/dispatch focuswindow class:d"));
+ OK(getFromSocket("/dispatch hl.dsp.focus({ window = 'class:d' })"));
- OK(getFromSocket("/dispatch layoutmsg focus r"));
+ OK(getFromSocket("/dispatch hl.dsp.layout('focus r')"));
{
auto str = getFromSocket("/activewindow");
@@ -123,12 +123,12 @@ static void testSwapcolWrapping() {
}
// set wrap_swapcol to true
- OK(getFromSocket("/keyword scrolling:wrap_swapcol true"));
+ OK(getFromSocket("/eval hl.config({ scrolling = { wrap_swapcol = true } })"));
- OK(getFromSocket("/dispatch focuswindow class:a"));
+ OK(getFromSocket("/dispatch hl.dsp.focus({ window = 'class:a' })"));
- OK(getFromSocket("/dispatch layoutmsg swapcol l"));
- OK(getFromSocket("/dispatch layoutmsg focus l"));
+ OK(getFromSocket("/dispatch hl.dsp.layout('swapcol l')"));
+ OK(getFromSocket("/dispatch hl.dsp.layout('focus l')"));
{
auto str = getFromSocket("/activewindow");
@@ -148,9 +148,9 @@ static void testSwapcolWrapping() {
}
}
- OK(getFromSocket("/dispatch focuswindow class:d"));
- OK(getFromSocket("/dispatch layoutmsg swapcol r"));
- OK(getFromSocket("/dispatch layoutmsg focus r"));
+ OK(getFromSocket("/dispatch hl.dsp.focus({ window = 'class:d' })"));
+ OK(getFromSocket("/dispatch hl.dsp.layout('swapcol r')"));
+ OK(getFromSocket("/dispatch hl.dsp.layout('focus r')"));
{
auto str = getFromSocket("/activewindow");
@@ -171,22 +171,22 @@ static void testSwapcolWrapping() {
}
// set wrap_swapcol to false
- OK(getFromSocket("/keyword scrolling:wrap_swapcol false"));
+ OK(getFromSocket("/eval hl.config({ scrolling = { wrap_swapcol = false } })"));
- OK(getFromSocket("/dispatch focuswindow class:a"));
+ OK(getFromSocket("/dispatch hl.dsp.focus({ window = 'class:a' })"));
- OK(getFromSocket("/dispatch layoutmsg swapcol l"));
- OK(getFromSocket("/dispatch layoutmsg focus r"));
+ OK(getFromSocket("/dispatch hl.dsp.layout('swapcol l')"));
+ OK(getFromSocket("/dispatch hl.dsp.layout('focus r')"));
{
auto str = getFromSocket("/activewindow");
EXPECT_CONTAINS(str, "class: b");
}
- OK(getFromSocket("/dispatch focuswindow class:d"));
+ OK(getFromSocket("/dispatch hl.dsp.focus({ window = 'class:d' })"));
- OK(getFromSocket("/dispatch layoutmsg swapcol r"));
- OK(getFromSocket("/dispatch layoutmsg focus l"));
+ OK(getFromSocket("/dispatch hl.dsp.layout('swapcol r')"));
+ OK(getFromSocket("/dispatch hl.dsp.layout('focus l')"));
{
auto str = getFromSocket("/activewindow");
@@ -202,8 +202,8 @@ 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"));
+ OK(getFromSocket("/eval hl.window_rule({ name = 'scrolling-width', match = { class = 'kitty_scroll' } })"));
+ OK(getFromSocket("/eval hl.window_rule({ name = 'scrolling-width', scrolling_width = 0.1 })"));
if (!Tests::spawnKitty("kitty_scroll")) {
NLog::log("{}Failed to spawn kitty with win class `kitty_scroll`", Colors::RED);
@@ -230,8 +230,8 @@ static bool test() {
NLog::log("{}Testing Scroll layout", Colors::GREEN);
// setup
- OK(getFromSocket("/dispatch workspace name:scroll"));
- OK(getFromSocket("/keyword general:layout scrolling"));
+ OK(getFromSocket("/dispatch hl.dsp.focus({ workspace = 'name:scroll' })"));
+ OK(getFromSocket("r/eval hl.config({ general = { layout = 'scrolling' } })"));
// test
NLog::log("{}Testing focus cycling", Colors::GREEN);
@@ -249,7 +249,7 @@ static bool test() {
// clean up
NLog::log("Cleaning up", Colors::YELLOW);
- OK(getFromSocket("/dispatch workspace 1"));
+ OK(getFromSocket("/dispatch hl.dsp.focus({ workspace = '1' })"));
OK(getFromSocket("/reload"));
return !ret;