test(ui): isolate gtk display probe environment
- commit
- 312aa5200546b254c83ab9e885019f177c4f99b6
- author
- brice · · 2026-06-20 13:25 UTC
- parent
- 5a781c9
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
1 file · +6 -0
M internal/ui/app_browser_launch_test.go +6 -0
| @@ -306,6 +306,8 @@ func requireGTKDisplayApp(t *testing.T) *gtk.Application { | |||
| 306 | 306 | } | |
| 307 | 307 | ||
| 308 | 308 | func Test_testHasUsableGTKDisplay_PureProbe(t *testing.T) { | |
| 309 | + | t.Setenv("GDK_BACKEND", "") | |
| 310 | + | ||
| 309 | 311 | t.Run("no display env vars", func(t *testing.T) { | |
| 310 | 312 | t.Setenv("DISPLAY", "") | |
| 311 | 313 | t.Setenv("WAYLAND_DISPLAY", "") | |
| @@ -596,6 +598,8 @@ func Test_testHasX11Auth_MalformedRecords(t *testing.T) { | |||
| 596 | 598 | } | |
| 597 | 599 | ||
| 598 | 600 | func Test_testHasUsableWaylandDisplay_PureProbe(t *testing.T) { | |
| 601 | + | t.Setenv("GDK_BACKEND", "") | |
| 602 | + | ||
| 599 | 603 | t.Run("no WAYLAND_DISPLAY", func(t *testing.T) { | |
| 600 | 604 | t.Setenv("WAYLAND_DISPLAY", "") | |
| 601 | 605 | if got := testHasUsableWaylandDisplay(); got { | |
| @@ -626,6 +630,8 @@ func Test_testHasUsableWaylandDisplay_PureProbe(t *testing.T) { | |||
| 626 | 630 | } | |
| 627 | 631 | ||
| 628 | 632 | func Test_testHasUsableX11Display_PureProbe(t *testing.T) { | |
| 633 | + | t.Setenv("GDK_BACKEND", "") | |
| 634 | + | ||
| 629 | 635 | t.Run("no DISPLAY", func(t *testing.T) { | |
| 630 | 636 | t.Setenv("DISPLAY", "") | |
| 631 | 637 | if got := testHasUsableX11Display(); got { | |
| @@ -306,6 +306,8 @@ func requireGTKDisplayApp(t *testing.T) *gtk.Application { | |||||
| 306 | } | 306 | } | ||
| 307 | 307 | ||||
| 308 | func Test_testHasUsableGTKDisplay_PureProbe(t *testing.T) { | 308 | func Test_testHasUsableGTKDisplay_PureProbe(t *testing.T) { | ||
| 309 | + | t.Setenv("GDK_BACKEND", "") | |||
| 310 | + | ||||
| 309 | t.Run("no display env vars", func(t *testing.T) { | 311 | t.Run("no display env vars", func(t *testing.T) { | ||
| 310 | t.Setenv("DISPLAY", "") | 312 | t.Setenv("DISPLAY", "") | ||
| 311 | t.Setenv("WAYLAND_DISPLAY", "") | 313 | t.Setenv("WAYLAND_DISPLAY", "") | ||
| @@ -596,6 +598,8 @@ func Test_testHasX11Auth_MalformedRecords(t *testing.T) { | |||||
| 596 | } | 598 | } | ||
| 597 | 599 | ||||
| 598 | func Test_testHasUsableWaylandDisplay_PureProbe(t *testing.T) { | 600 | func Test_testHasUsableWaylandDisplay_PureProbe(t *testing.T) { | ||
| 601 | + | t.Setenv("GDK_BACKEND", "") | |||
| 602 | + | ||||
| 599 | t.Run("no WAYLAND_DISPLAY", func(t *testing.T) { | 603 | t.Run("no WAYLAND_DISPLAY", func(t *testing.T) { | ||
| 600 | t.Setenv("WAYLAND_DISPLAY", "") | 604 | t.Setenv("WAYLAND_DISPLAY", "") | ||
| 601 | if got := testHasUsableWaylandDisplay(); got { | 605 | if got := testHasUsableWaylandDisplay(); got { | ||
| @@ -626,6 +630,8 @@ func Test_testHasUsableWaylandDisplay_PureProbe(t *testing.T) { | |||||
| 626 | } | 630 | } | ||
| 627 | 631 | ||||
| 628 | func Test_testHasUsableX11Display_PureProbe(t *testing.T) { | 632 | func Test_testHasUsableX11Display_PureProbe(t *testing.T) { | ||
| 633 | + | t.Setenv("GDK_BACKEND", "") | |||
| 634 | + | ||||
| 629 | t.Run("no DISPLAY", func(t *testing.T) { | 635 | t.Run("no DISPLAY", func(t *testing.T) { | ||
| 630 | t.Setenv("DISPLAY", "") | 636 | t.Setenv("DISPLAY", "") | ||
| 631 | if got := testHasUsableX11Display(); got { | 637 | if got := testHasUsableX11Display(); got { | ||