Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix panic when update with slice / map val #156

Conversation

x-xy-y
Copy link

@x-xy-y x-xy-y commented Mar 7, 2022

修复一个 panic 错误,在 #151 中引入。
对应测试用例 TestConfig_Update,当配置值为 slice 或 map 时,发生 panic.

archaius_test.go Outdated
@@ -116,6 +114,20 @@ func TestConfig_RegisterListener(t *testing.T) {

}

func TestConfig_Update(t *testing.T) {
assert.NoError(t, archaius.Set("aNumber", 1))
Copy link
Member

@tianxiaoliang tianxiaoliang Mar 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个需要使用t.Run来给出一个case name。另外建议用表格驱动测试,来搞定这个简单的测试场景https://feixiao.github.io/testing/table_driven_test.html

否则长此以往,UT就不可维护了

@tianxiaoliang tianxiaoliang merged commit 318adb6 into go-chassis:v1.6.0.beta Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants