2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-26 14:56:29 +00:00
restic/cmd/restic/cmd_snapshots_test.go
2021-01-30 20:02:37 +01:00

20 lines
419 B
Go

package main
import (
"strings"
"testing"
rtest "github.com/restic/restic/internal/test"
)
// Regression test for #2979: no snapshots should print as [], not null.
func TestEmptySnapshotGroupJSON(t *testing.T) {
for _, grouped := range []bool{false, true} {
var w strings.Builder
err := printSnapshotGroupJSON(&w, nil, grouped)
rtest.OK(t, err)
rtest.Equals(t, "[]", strings.TrimSpace(w.String()))
}
}