diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-10-10 02:23:34 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-10-10 02:23:34 +0900 |
| commit | 22ee5ae151fa991cf23dbf1b3efb5a0d6fb9b092 (patch) | |
| tree | f0bac6b7a1d52af021f9e48c9d04cb371f291a0e /internal/app/outcome_test.go | |
| parent | 4246256d781f169b86f76d8654f6df5ffc6ddae6 (diff) | |
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 <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/outcome_test.go')
| -rw-r--r-- | internal/app/outcome_test.go | 47 |
1 files changed, 0 insertions, 47 deletions
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) - } - }) - } -} |
