From 22ee5ae151fa991cf23dbf1b3efb5a0d6fb9b092 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Fri, 10 Oct 2025 02:23:34 +0900 Subject: internal/app: filter ops in implementation This is cleaner and less error-prone, and should also result in negligibly less memory allocation. Signed-off-by: Ophestra --- internal/app/outcome_test.go | 47 -------------------------------------------- 1 file changed, 47 deletions(-) (limited to 'internal/app/outcome_test.go') diff --git a/internal/app/outcome_test.go b/internal/app/outcome_test.go index 81fb6c7d..183dbfd4 100644 --- a/internal/app/outcome_test.go +++ b/internal/app/outcome_test.go @@ -1,7 +1,6 @@ package app import ( - "reflect" "testing" "hakurei.app/hst" @@ -30,49 +29,3 @@ func TestOutcomeStateValid(t *testing.T) { }) } } - -func TestFromConfig(t *testing.T) { - testCases := []struct { - name string - config *hst.Config - want []outcomeOp - }{ - {"ne", new(hst.Config), []outcomeOp{ - &spParamsOp{}, - spFilesystemOp{}, - spRuntimeOp{}, - spTmpdirOp{}, - spAccountOp{}, - spFinal{}, - }}, - {"wayland pulse", &hst.Config{Enablements: hst.NewEnablements(hst.EWayland | hst.EPulse)}, []outcomeOp{ - &spParamsOp{}, - spFilesystemOp{}, - spRuntimeOp{}, - spTmpdirOp{}, - spAccountOp{}, - &spWaylandOp{}, - &spPulseOp{}, - spFinal{}, - }}, - {"all", &hst.Config{Enablements: hst.NewEnablements(0xff)}, []outcomeOp{ - &spParamsOp{}, - spFilesystemOp{}, - spRuntimeOp{}, - spTmpdirOp{}, - spAccountOp{}, - &spWaylandOp{}, - &spX11Op{}, - &spPulseOp{}, - &spDBusOp{}, - spFinal{}, - }}, - } - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - if got := fromConfig(tc.config); !reflect.DeepEqual(got, tc.want) { - t.Errorf("fromConfig: %#v, want %#v", got, tc.want) - } - }) - } -} -- cgit v1.3.1