Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Further tests for String.Concat and String.Join #10966

Merged
merged 8 commits into from
Aug 19, 2016

Conversation

jamesqo
Copy link
Contributor

@jamesqo jamesqo commented Aug 18, 2016

This increases the test coverage for string.Concat and string.Join by calling Join<T> and Concat<T> with a type parameter of string, as well as adding tests for a couple of other edge cases..

cc @hughbe @stephentoub


var iEnumerableObject = new List<object>(values);
Assert.Equal(expected, string.Join(seperator, iEnumerableObject));

// We're taking advantage of covariant arrays (which is bad) here,
// but this should not be a problem since Join shouldn't write to the array
Copy link
Member

Choose a reason for hiding this comment

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

This comment isn't necessary.

@stephentoub
Copy link
Member

One nit, otherwise LGTM. Thanks.

@jamesqo jamesqo force-pushed the string-join-concat-tests branch from 1807f0f to d594865 Compare August 19, 2016 17:11
@jamesqo
Copy link
Contributor Author

jamesqo commented Aug 19, 2016

I ran into a few quirks including the Join(string, object[]) bug where it will return null if the first item is null, and another one where Concat(object) returns null if the ToString is null. Have updated the tests to account for these, everything should pass now.

@stephentoub
Copy link
Member

LGTM. Thanks for the additions.

@stephentoub stephentoub merged commit 6f6f34d into dotnet:master Aug 19, 2016
@jamesqo jamesqo deleted the string-join-concat-tests branch August 19, 2016 18:52
@karelz karelz modified the milestone: 1.1.0 Dec 3, 2016
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants