Skip to content

Commit

Permalink
TestCloneAppconfig: check deep clone modification
Browse files Browse the repository at this point in the history
  • Loading branch information
alichay committed Apr 13, 2023
1 parent 0b75424 commit 7c5c570
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/appconfig/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,18 @@ func TestCloneAppconfig(t *testing.T) {
Source: "src",
Destination: "dst",
},
HttpService: &HTTPService{
InternalPort: 100,
},
defaultGroupName: "some-group",
}

cloned := helpers.Clone(config)

assert.Equal(t, config, cloned)

config.HttpService.InternalPort = 50

assert.Equal(t, 100, cloned.HttpService.InternalPort,
"expected deep copy, but cloned object was modified by change to original config")
}

0 comments on commit 7c5c570

Please sign in to comment.