mirror of
https://github.com/onyx-and-iris/exclude.git
synced 2026-04-16 14:13:39 +00:00
add del command
add tests for all commands wrap entry point with fang add --version flag target to Taskfile
This commit is contained in:
28
cmd/reset_test.go
Normal file
28
cmd/reset_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRunResetCommand(t *testing.T) {
|
||||
var buf bytes.Buffer
|
||||
|
||||
if err := resetAndWriteExcludeFile(&buf); err != nil {
|
||||
t.Fatalf("resetAndWriteExcludeFile failed: %v", err)
|
||||
}
|
||||
|
||||
resetContent, err := io.ReadAll(&buf)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to read from temp file: %v", err)
|
||||
}
|
||||
|
||||
if string(resetContent) != defaultExcludeFileContent {
|
||||
t.Errorf(
|
||||
"unexpected content after reset:\nGot:\n%s\nExpected:\n%s",
|
||||
string(resetContent),
|
||||
defaultExcludeFileContent,
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user