2
2
mirror of https://github.com/octoleo/restic.git synced 2024-05-28 06:30:53 +00:00

Merge pull request #2988 from greatroar/snapshots-json

Regression test for #2979
This commit is contained in:
rawtaz 2020-10-05 21:02:52 +02:00 committed by GitHub
commit 5d8cfff3f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,18 @@
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()))
}
}