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

Add unit test for func stringMapToString. #6280

Merged
merged 1 commit into from
Jun 15, 2020
Merged

Add unit test for func stringMapToString. #6280

merged 1 commit into from
Jun 15, 2020

Conversation

hs0210
Copy link
Contributor

@hs0210 hs0210 commented Jun 8, 2020

Signed-off-by: Hu Shuai hus.fnst@cn.fujitsu.com

@hs0210 hs0210 requested a review from sougou as a code owner June 8, 2020 09:13
@@ -129,3 +131,7 @@ func TestDropVariable(t *testing.T) {
_ = NewGaugesWithSingleLabel("dropTest", "help", "label")
_ = NewGaugesWithSingleLabel("dropTest", "help", "label")
}

func TestStringMapToString(t *testing.T) {
assert.Equal(t, stringMapToString(map[string]string{"foo": "bar"}), "{\"foo\": \"bar\"}")
Copy link
Contributor

Choose a reason for hiding this comment

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

This will be flaky because map iteration does not guarantee order. You'll need to test for one of both outcomes.

Signed-off-by: Hu Shuai <hus.fnst@cn.fujitsu.com>
@sougou sougou merged commit 34be289 into vitessio:master Jun 15, 2020
@hs0210 hs0210 deleted the work branch June 24, 2020 01:21
@deepthi deepthi added this to the v7.0 milestone Jul 27, 2020
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.

3 participants