Skip to content

Commit 09b6922

Browse files
authored
test(profilemaker): add tests for # in monitor description (#63)
## What does this PR do? Adds tests for #62. ## How to test this PR locally? Regen fixtures with: `go test ./internal/profilemaker -v -regenerate`, then `make test/unit`. ## Related issues Related to #61
2 parents 230cf88 + d11a498 commit 09b6922

File tree

7 files changed

+18
-0
lines changed

7 files changed

+18
-0
lines changed

internal/profilemaker/service_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,18 @@ func TestService_EditExisting(t *testing.T) {
6464
Scale: 1.0,
6565
Transform: 0,
6666
},
67+
{
68+
ID: utils.IntPtr(4),
69+
Name: "monD",
70+
Description: "Dell #Whatever",
71+
Width: 1337,
72+
Height: 500,
73+
RefreshRate: 60.0,
74+
X: 2137,
75+
Y: -5000,
76+
Scale: 2.0,
77+
Transform: 2,
78+
},
6779
}
6880

6981
for _, monitor := range monitors {

internal/profilemaker/testdata/expected_append_broken_markers.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ bind = $mainMod, Q, exec, kitty
1010
monitor=desc:New Monitor A,2560x1440@120.00000,0x0,1.50,transform,0,vrr,0
1111
monitor=desc:New Monitor B,1920x1080@60.00000,2560x0,1.00,transform,0,vrr,1,bitdepth,10,cm,hdr,sdrbrightness,1.10,sdrsaturation,0.98,mirror,eDP-1
1212
monitor=monC,1000x1000@60.00000,-1000x-1000,1.00,transform,0,vrr,0
13+
monitor=desc:Dell ##Whatever,1337x500@60.00000,2137x-5000,2.00,transform,2,vrr,0
1314
# <<<<< TUI AUTO END

internal/profilemaker/testdata/expected_append_no_markers.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ bind = $mainMod, C, killactive
88
monitor=desc:New Monitor A,2560x1440@120.00000,0x0,1.50,transform,0,vrr,0
99
monitor=desc:New Monitor B,1920x1080@60.00000,2560x0,1.00,transform,0,vrr,1,bitdepth,10,cm,hdr,sdrbrightness,1.10,sdrsaturation,0.98,mirror,eDP-1
1010
monitor=monC,1000x1000@60.00000,-1000x-1000,1.00,transform,0,vrr,0
11+
monitor=desc:Dell ##Whatever,1337x500@60.00000,2137x-5000,2.00,transform,2,vrr,0
1112
# <<<<< TUI AUTO END

internal/profilemaker/testdata/expected_empty_config.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
monitor=desc:New Monitor A,2560x1440@120.00000,0x0,1.50,transform,0,vrr,0
33
monitor=desc:New Monitor B,1920x1080@60.00000,2560x0,1.00,transform,0,vrr,1,bitdepth,10,cm,hdr,sdrbrightness,1.10,sdrsaturation,0.98,mirror,eDP-1
44
monitor=monC,1000x1000@60.00000,-1000x-1000,1.00,transform,0,vrr,0
5+
monitor=desc:Dell ##Whatever,1337x500@60.00000,2137x-5000,2.00,transform,2,vrr,0
56
# <<<<< TUI AUTO END

internal/profilemaker/testdata/expected_markers_only.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
monitor=desc:New Monitor A,2560x1440@120.00000,0x0,1.50,transform,0,vrr,0
33
monitor=desc:New Monitor B,1920x1080@60.00000,2560x0,1.00,transform,0,vrr,1,bitdepth,10,cm,hdr,sdrbrightness,1.10,sdrsaturation,0.98,mirror,eDP-1
44
monitor=monC,1000x1000@60.00000,-1000x-1000,1.00,transform,0,vrr,0
5+
monitor=desc:Dell ##Whatever,1337x500@60.00000,2137x-5000,2.00,transform,2,vrr,0
56
# <<<<< TUI AUTO END

internal/profilemaker/testdata/expected_non_existent.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
monitor=desc:New Monitor A,2560x1440@120.00000,0x0,1.50,transform,0,vrr,0
33
monitor=desc:New Monitor B,1920x1080@60.00000,2560x0,1.00,transform,0,vrr,1,bitdepth,10,cm,hdr,sdrbrightness,1.10,sdrsaturation,0.98,mirror,eDP-1
44
monitor=monC,1000x1000@60.00000,-1000x-1000,1.00,transform,0,vrr,0
5+
monitor=desc:Dell ##Whatever,1337x500@60.00000,2137x-5000,2.00,transform,2,vrr,0
56
# <<<<< TUI AUTO END

internal/profilemaker/testdata/expected_replace_markers.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ source = ~/.config/hypr/monitors.conf
55
monitor=desc:New Monitor A,2560x1440@120.00000,0x0,1.50,transform,0,vrr,0
66
monitor=desc:New Monitor B,1920x1080@60.00000,2560x0,1.00,transform,0,vrr,1,bitdepth,10,cm,hdr,sdrbrightness,1.10,sdrsaturation,0.98,mirror,eDP-1
77
monitor=monC,1000x1000@60.00000,-1000x-1000,1.00,transform,0,vrr,0
8+
monitor=desc:Dell ##Whatever,1337x500@60.00000,2137x-5000,2.00,transform,2,vrr,0
89
# <<<<< TUI AUTO END
910

1011

0 commit comments

Comments
 (0)