restic/cmd/restic/cmd_ls_integration_test.go
2023-05-26 19:38:44 +02:00

19 lines
409 B
Go

package main
import (
"context"
"strings"
"testing"
rtest "github.com/restic/restic/internal/test"
)
func testRunLs(t testing.TB, gopts GlobalOptions, snapshotID string) []string {
buf, err := withCaptureStdout(func() error {
gopts.Quiet = true
opts := LsOptions{}
return runLs(context.TODO(), opts, gopts, []string{snapshotID})
})
rtest.OK(t, err)
return strings.Split(buf.String(), "\n")
}