Skip to content

Commit a42b15e

Browse files
committed
test location with mapping not found
1 parent 9ae7ccc commit a42b15e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

pdata/pprofile/location_test.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,25 @@ func TestLocationSwitchDictionary(t *testing.T) {
129129
return d
130130
}(),
131131
},
132+
{
133+
name: "with a mapping that cannot be found",
134+
location: func() Location {
135+
l := NewLocation()
136+
l.SetMappingIndex(1)
137+
return l
138+
}(),
139+
140+
src: NewProfilesDictionary(),
141+
dst: NewProfilesDictionary(),
142+
143+
wantLocation: func() Location {
144+
l := NewLocation()
145+
l.SetMappingIndex(1)
146+
return l
147+
}(),
148+
wantDictionary: NewProfilesDictionary(),
149+
wantErr: errors.New("invalid mapping index 1"),
150+
},
132151
{
133152
name: "with an existing attribute",
134153
location: func() Location {

0 commit comments

Comments
 (0)