Summary #
- Consumer-Defined
RunnerInterface: Move theRunnerinterface frominternal/beets(the provider package) tointernal/server(its sole consumer), decouplingserver.goandserver_test.gofrom importinginternal/beets. - Encapsulate Server Test Doubles: Unexport
MockRunnerintointernal/server(mockRunnerinserver_test.go) instead of exporting it frominternal/testutil, keepinginternal/testutilfocused on shared HTTP response writer helpers (NonFlusherWriter). - Beets Runner Binary Normalization & Cancellation Test: Trim whitespace on
binPathinbeets.NewCLIBeetsRunnerbefore defaulting to"beet", and useexec sleep 5inTestRunStream_contextCancellation_terminatesProcesssoSIGKILLterminates the sleeping process directly rather than leaving an orphaned child holding the stdout pipe open for 5 seconds.