Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add test case
  • Loading branch information
jsoriano committed Jul 3, 2023
commit 1131866bcff98c29e2c84bcc1c772fff4307aaca
51 changes: 51 additions & 0 deletions internal/fields/dependency_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,57 @@ func TestDependencyManagerInjectExternalFields(t *testing.T) {
valid: true,
changed: false,
},
{
title: "sequence of nested definitions to ensure recursion does not have side effects",
defs: []common.MapStr{
{
"name": "container",
"type": "group",
"fields": []interface{}{
common.MapStr{
"name": "id",
"external": "test",
},
},
},
{
"name": "host",
"type": "group",
"fields": []interface{}{
common.MapStr{
"name": "id",
"external": "test",
},
},
},
},
result: []common.MapStr{
{
"name": "container",
"type": "group",
"fields": []common.MapStr{
{
"name": "id",
"description": "Container identifier.",
"type": "keyword",
},
},
},
{
"name": "host",
"type": "group",
"fields": []common.MapStr{
{
"name": "id",
"description": "Unique host id",
"type": "keyword",
},
},
},
},
valid: true,
changed: true,
},
}

indexFalse := false
Expand Down