2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-26 06:46:34 +00:00
restic/cmd/restic/cmd_ls_integration_test.go
2023-05-26 19:38:44 +02:00

20 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")
}