mirror of
https://github.com/octoleo/restic.git
synced 2024-11-29 16:23:59 +00:00
Regression test for #2979
This commit is contained in:
parent
137d20a06a
commit
6bee0aafc2
18
cmd/restic/cmd_snapshots_test.go
Normal file
18
cmd/restic/cmd_snapshots_test.go
Normal 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()))
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user