Skip to content

Commit 3dc4ccc

Browse files
itssaharshMrAlias
andauthored
Add test cases to TestEmit in attribute (#7751)
Add test cases for `Key.Emit()` values: - `BoolSliceValue` - `IntValue` - `IntSliceValue` --------- Co-authored-by: Tyler Yahn <[email protected]>
1 parent a86bf87 commit 3dc4ccc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

attribute/key_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ func TestEmit(t *testing.T) {
6363
v: attribute.BoolValue(true),
6464
want: "true",
6565
},
66+
{
67+
name: `test Key.Emit() can emit a string representing self.BOOLSLICE`,
68+
v: attribute.BoolSliceValue([]bool{true, false, true}),
69+
want: `[true false true]`,
70+
},
6671
{
6772
name: `test Key.Emit() can emit a string representing self.INT64SLICE`,
6873
v: attribute.Int64SliceValue([]int64{1, 42}),
@@ -73,6 +78,16 @@ func TestEmit(t *testing.T) {
7378
v: attribute.Int64Value(42),
7479
want: "42",
7580
},
81+
{
82+
name: `test Key.Emit() can representing an int value`,
83+
v: attribute.IntValue(7),
84+
want: "7",
85+
},
86+
{
87+
name: `test Key.Emit() can represent an []int value`,
88+
v: attribute.IntSliceValue([]int{1, 2, 3}),
89+
want: `[1,2,3]`,
90+
},
7691
{
7792
name: `test Key.Emit() can emit a string representing self.FLOAT64SLICE`,
7893
v: attribute.Float64SliceValue([]float64{1.0, 42.5}),

0 commit comments

Comments
 (0)