Files
exclude/cmd/testhelpers_test.go
onyx-and-iris a149ce347b simplify del/reset commands by using readWriteTruncater interface.
remove the type assertions

update the tests:
the tests now check output as well as file contents separately.
2026-04-07 01:22:56 +01:00

19 lines
375 B
Go

package cmd
import "bytes"
// seekBuffer wraps bytes.Buffer to satisfy the readWriteTruncater interface,
// allowing it to be used in place of *os.File in tests.
type seekBuffer struct {
bytes.Buffer
}
func (s *seekBuffer) Seek(offset int64, whence int) (int64, error) {
return 0, nil
}
func (s *seekBuffer) Truncate(size int64) error {
s.Buffer.Reset()
return nil
}