Skip to content

Commit

Permalink
Add test cases for merging nil values
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksontj committed Jun 12, 2018
1 parent 4ee63fe commit 8608fbe
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions promhttputil/merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 8608fbe

Please sign in to comment.