@@ -38,16 +38,12 @@ func TestMetricProducer(t *testing.T) {
38
38
for _ , tc := range []struct {
39
39
desc string
40
40
input []* ocmetricdata.Metric
41
- expected metricdata.ScopeMetrics
41
+ expected [] metricdata.ScopeMetrics
42
42
expectErr bool
43
43
}{
44
44
{
45
- desc : "empty" ,
46
- expected : metricdata.ScopeMetrics {
47
- Scope : instrumentation.Scope {
48
- Name : scopeName ,
49
- },
50
- },
45
+ desc : "empty" ,
46
+ expected : nil ,
51
47
},
52
48
{
53
49
desc : "success" ,
@@ -69,7 +65,7 @@ func TestMetricProducer(t *testing.T) {
69
65
},
70
66
},
71
67
},
72
- expected : metricdata.ScopeMetrics {
68
+ expected : [] metricdata.ScopeMetrics { {
73
69
Scope : instrumentation.Scope {
74
70
Name : scopeName ,
75
71
},
@@ -87,7 +83,7 @@ func TestMetricProducer(t *testing.T) {
87
83
},
88
84
},
89
85
},
90
- },
86
+ }} ,
91
87
},
92
88
{
93
89
desc : "partial success" ,
@@ -117,7 +113,7 @@ func TestMetricProducer(t *testing.T) {
117
113
},
118
114
},
119
115
},
120
- expected : metricdata.ScopeMetrics {
116
+ expected : [] metricdata.ScopeMetrics { {
121
117
Scope : instrumentation.Scope {
122
118
Name : scopeName ,
123
119
},
@@ -135,7 +131,7 @@ func TestMetricProducer(t *testing.T) {
135
131
},
136
132
},
137
133
},
138
- },
134
+ }} ,
139
135
expectErr : true ,
140
136
},
141
137
} {
@@ -149,8 +145,10 @@ func TestMetricProducer(t *testing.T) {
149
145
} else {
150
146
require .Nil (t , err )
151
147
}
152
- require .Equal (t , len (output ), 1 )
153
- metricdatatest .AssertEqual (t , tc .expected , output [0 ])
148
+ require .Equal (t , len (output ), len (tc .expected ))
149
+ for i := range output {
150
+ metricdatatest .AssertEqual (t , tc .expected [i ], output [i ])
151
+ }
154
152
})
155
153
}
156
154
}
0 commit comments