Files
exclude/cmd/reset_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

25 lines
422 B
Go

package cmd
import (
"bytes"
"testing"
)
func TestRunResetCommand(t *testing.T) {
var out bytes.Buffer
var f seekBuffer
if err := resetAndWriteExcludeFile(&out, &f); err != nil {
t.Fatalf("resetAndWriteExcludeFile failed: %v", err)
}
if f.String() != defaultExcludeFileContent {
t.Errorf(
"unexpected content after reset:\nGot:\n%s\nExpected:\n%s",
f.String(),
defaultExcludeFileContent,
)
}
}