Skip to content

Commit 3b1d852

Browse files
committed
Add tests with multiple keys and with expression value key
1 parent 9beb8a6 commit 3b1d852

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

pkg/ottl/contexts/internal/ctxprofile/profile_test.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,34 @@ func TestPathGetSetter(t *testing.T) {
158158
},
159159
val: "val",
160160
},
161+
{
162+
path: "attributes",
163+
keys: []ottl.Key[*profileContext]{
164+
&pathtest.Key[*profileContext]{
165+
S: ottltest.Strp("akey"),
166+
},
167+
&pathtest.Key[*profileContext]{
168+
S: ottltest.Strp("bkey"),
169+
},
170+
},
171+
val: "val",
172+
},
173+
{
174+
path: "attributes",
175+
keys: []ottl.Key[*profileContext]{
176+
&pathtest.Key[*profileContext]{
177+
G: &ottl.StandardGetSetter[*profileContext]{
178+
Getter: func(context.Context, *profileContext) (any, error) {
179+
return "", nil
180+
},
181+
Setter: func(context.Context, *profileContext, any) error {
182+
return nil
183+
},
184+
},
185+
},
186+
},
187+
val: "val",
188+
},
161189
}
162190

163191
for _, tt := range tests {

0 commit comments

Comments
 (0)