Debian Codegraph @

hyprtester/src/tests/main/layout_custom.cpp

raw
1 #include "../shared.hpp"
2 #include "../../shared.hpp"
3 #include "../../hyprctlCompat.hpp"
4 #include "tests.hpp"
5
6 TEST_CASE(layoutCustomGrid) {
7 OK(getFromSocket("r/eval hl.config({ general = { layout = 'lua:grid' } })"));
8
9 ASSERT(!!Tests::spawnKitty("kitty_A"), true);
10 ASSERT(!!Tests::spawnKitty("kitty_B"), true);
11
12 {
13 auto clients = getFromSocket("/clients");
14 EXPECT_COUNT_STRING(clients, "size: 931,1036", 2);
15 }
16
17 ASSERT(!!Tests::spawnKitty("kitty_C"), true);
18
19 {
20 auto clients = getFromSocket("/clients");
21 EXPECT_COUNT_STRING(clients, "size: 931,511", 3);
22 }
23
24 ASSERT(!!Tests::spawnKitty("kitty_D"), true);
25
26 {
27 auto clients = getFromSocket("/clients");
28 EXPECT_COUNT_STRING(clients, "size: 931,511", 4);
29 }
30 }
31
32 TEST_CASE(layoutCustomColumns) {
33 OK(getFromSocket("r/eval hl.config({ general = { layout = 'lua:columns' } })"));
34
35 ASSERT(!!Tests::spawnKitty("kitty_A"), true);
36 ASSERT(!!Tests::spawnKitty("kitty_B"), true);
37
38 {
39 auto clients = getFromSocket("/clients");
40 EXPECT_COUNT_STRING(clients, "size: 931,1036", 2);
41 }
42
43 ASSERT(!!Tests::spawnKitty("kitty_C"), true);
44
45 {
46 auto clients = getFromSocket("/clients");
47 EXPECT_COUNT_STRING(clients, ",1036\n", 3); // this won't split evenly
48 }
49
50 ASSERT(!!Tests::spawnKitty("kitty_D"), true);
51
52 {
53 auto clients = getFromSocket("/clients");
54 EXPECT_COUNT_STRING(clients, ",1036\n", 4); // this won't split evenly
55 }
56 }