Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a66235eb4 |
@@ -524,12 +524,12 @@ func (v *Vaultik) printRemoteInfoTable(result *RemoteInfoResult) {
|
|||||||
v.stdoutf("%s", separator)
|
v.stdoutf("%s", separator)
|
||||||
|
|
||||||
for _, info := range result.Snapshots {
|
for _, info := range result.Snapshots {
|
||||||
blobCount := unknownText
|
blobCount := countUnknown
|
||||||
if info.BlobCount != nil {
|
if info.BlobCount != nil {
|
||||||
blobCount = humanize.Comma(int64(*info.BlobCount))
|
blobCount = humanize.Comma(int64(*info.BlobCount))
|
||||||
}
|
}
|
||||||
|
|
||||||
blobsSize := unknownText
|
blobsSize := countUnknown
|
||||||
if info.BlobsSize != nil {
|
if info.BlobsSize != nil {
|
||||||
blobsSize = ubytes(*info.BlobsSize)
|
blobsSize = ubytes(*info.BlobsSize)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ func TestTableCountForReportSurfacesReadFailure(t *testing.T) {
|
|||||||
assert.Nil(t, missing, "a failed read is unknown, not a count")
|
assert.Nil(t, missing, "a failed read is unknown, not a count")
|
||||||
|
|
||||||
// The rendered count for a failed read must say unknown, never 0.
|
// The rendered count for a failed read must say unknown, never 0.
|
||||||
assert.Equal(t, unknownText, countText(missing))
|
assert.Equal(t, countUnknown, countText(missing))
|
||||||
assert.NotEqual(t, "0", countText(missing))
|
assert.NotEqual(t, "0", countText(missing))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ func TestCountTextDistinguishesEmptyFromUnknown(t *testing.T) {
|
|||||||
|
|
||||||
assert.Equal(t, "0", countText(&zero))
|
assert.Equal(t, "0", countText(&zero))
|
||||||
assert.Equal(t, "7", countText(&seven))
|
assert.Equal(t, "7", countText(&seven))
|
||||||
assert.Equal(t, unknownText, countText(nil))
|
assert.Equal(t, countUnknown, countText(nil))
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestCountDiffUnknownWhenEitherSideUnknown checks that a delta computed
|
// TestCountDiffUnknownWhenEitherSideUnknown checks that a delta computed
|
||||||
|
|||||||
@@ -1756,9 +1756,9 @@ func (v *Vaultik) PruneDatabase() (*PruneResult, error) {
|
|||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// unknownText is what a count or size reads as when it could not be
|
// countUnknown is what a count reads as when its query could not be run,
|
||||||
// determined, distinct from "0", which is a real zero.
|
// distinct from "0", which means the table really was empty.
|
||||||
const unknownText = "unknown"
|
const countUnknown = "unknown"
|
||||||
|
|
||||||
// tableCountForReport returns the row count of a table for the prune
|
// tableCountForReport returns the row count of a table for the prune
|
||||||
// summary, or nil if the count could not be read. A read failure is
|
// summary, or nil if the count could not be read. A read failure is
|
||||||
@@ -1795,7 +1795,7 @@ func countDiff(before, after *int64) *int64 {
|
|||||||
// one that could not be queried.
|
// one that could not be queried.
|
||||||
func countText(count *int64) string {
|
func countText(count *int64) string {
|
||||||
if count == nil {
|
if count == nil {
|
||||||
return unknownText
|
return countUnknown
|
||||||
}
|
}
|
||||||
|
|
||||||
return strconv.FormatInt(*count, 10)
|
return strconv.FormatInt(*count, 10)
|
||||||
|
|||||||
Reference in New Issue
Block a user