Commit 0a876bf 1 parent 3caf8b4 commit 0a876bf Copy full SHA for 0a876bf
File tree 1 file changed +4
-9
lines changed
opentelemetry-sdk/src/logs
1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -215,24 +215,19 @@ mod tests {
215
215
let attributes = vec ! [ ( Key :: new( "key" ) , AnyValue :: String ( "value" . into( ) ) ) ] ;
216
216
log_record. add_attributes ( attributes. clone ( ) ) ;
217
217
218
- let mut expected_attributes = AttributesGrowableArray :: new ( ) ;
219
218
for ( key, value) in attributes {
220
- expected_attributes . push ( Some ( ( key, value) ) ) ;
219
+ assert ! ( log_record . attributes_contains ( & key, & value) ) ;
221
220
}
222
- assert_eq ! ( log_record. attributes, expected_attributes) ;
223
221
}
224
222
225
223
#[ test]
226
224
fn test_set_attribute ( ) {
227
225
let mut log_record = LogRecord :: default ( ) ;
228
226
log_record. add_attribute ( "key" , "value" ) ;
229
227
230
- let expected_attributes = {
231
- let mut hybrid_vec = AttributesGrowableArray :: new ( ) ;
232
- hybrid_vec. push ( Some ( ( Key :: new ( "key" ) , AnyValue :: String ( "value" . into ( ) ) ) ) ) ;
233
- hybrid_vec
234
- } ;
235
- assert_eq ! ( log_record. attributes, expected_attributes) ;
228
+ let key = Key :: new ( "key" ) ;
229
+ let value = AnyValue :: String ( "value" . into ( ) ) ;
230
+ assert ! ( log_record. attributes_contains( & key, & value) ) ;
236
231
}
237
232
238
233
#[ test]
You can’t perform that action at this time.
0 commit comments