From 8608fbea471c71ae072d48d9c23e49b5a6d15aa5 Mon Sep 17 00:00:00 2001 From: Thomas Jackson Date: Tue, 12 Jun 2018 13:21:40 -0700 Subject: [PATCH] Add test cases for merging nil values --- promhttputil/merge_test.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/promhttputil/merge_test.go b/promhttputil/merge_test.go index 415b5e109..c76a3a9b8 100644 --- a/promhttputil/merge_test.go +++ b/promhttputil/merge_test.go @@ -25,6 +25,29 @@ func TestMergeValues(t *testing.T) { antiAffinity model.Time err error }{ + // + // edge-cases + { + name: "nils", + a: nil, + b: nil, + r: nil, + }, + + { + name: "bnil", + a: &model.Scalar{model.SampleValue(10), model.Time(100)}, + b: nil, + r: &model.Scalar{model.SampleValue(10), model.Time(100)}, + }, + + { + name: "anil", + a: nil, + b: &model.Scalar{model.SampleValue(10), model.Time(100)}, + r: &model.Scalar{model.SampleValue(10), model.Time(100)}, + }, + // // Scalar tests {