aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/metrics/description_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/metrics/description_test.go')
-rw-r--r--src/runtime/metrics/description_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/runtime/metrics/description_test.go b/src/runtime/metrics/description_test.go
index 0ee9ea16d0..71c7b00b02 100644
--- a/src/runtime/metrics/description_test.go
+++ b/src/runtime/metrics/description_test.go
@@ -156,3 +156,10 @@ func TestDocs(t *testing.T) {
fmt.Fprintf(os.Stderr, "go test -generate: doc.go already up-to-date\n")
}
}
+
+func TestReadEmptySlice(t *testing.T) {
+ // Test that Read does not panic when given an empty slice.
+ // This should be a no-op.
+ metrics.Read(nil)
+ metrics.Read([]metrics.Sample{})
+}