1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-26 01:37:12 +00:00
restic/cmd/restic/cmd_snapshots_test.go
2020-10-05 15:08:09 +02:00

18 lines
393 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
printSnapshotGroupJSON(&w, nil, grouped)
rtest.Equals(t, "[]", strings.TrimSpace(w.String()))
}
}