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

Additional String.StartsWith tests #3478

Merged
merged 1 commit into from
Sep 27, 2015
Merged

Additional String.StartsWith tests #3478

merged 1 commit into from
Sep 27, 2015

Conversation

bbowyersmyth
Copy link
Contributor

Greater coverage and StringComparision usage.

"Soft Hyphen" is ignored on all Windows cultures. I'll see from the CI build whether this is also holds true on Linux. Otherwise I might have to use a fixed culture and chars known to work.

@bbowyersmyth
Copy link
Contributor Author

@dotnet-bot test this please

if (comparisionType == StringComparison.CurrentCulture)
{
Assert.Equal(expected, text.StartsWith(value));
}
Copy link
Member

Choose a reason for hiding this comment

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

Why have this special case? Wouldn't be sufficient to just always do:

Assert.Equal(expected, text.StartsWith(value, comparisonType);

?

Copy link
Contributor

Choose a reason for hiding this comment

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

I've seen this pattern done (and done it my self) in a few places for code coverage purposes (now you get String.StartsWith(String) covered)).

Personally, I could go either way.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, makes sense. Ok.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep that was the reason. Just to get it included in the testing.

@stephentoub
Copy link
Member

cc; @ellismg, @tarekgh

@ellismg
Copy link
Contributor

ellismg commented Sep 26, 2015

LGTM. Nice to see ICU passing on this as well! Thanks very much for these additions!

@bbowyersmyth
Copy link
Contributor Author

Fixed comparisonType typo

stephentoub added a commit that referenced this pull request Sep 27, 2015
@stephentoub stephentoub merged commit 8088549 into dotnet:master Sep 27, 2015
@bbowyersmyth bbowyersmyth deleted the StringStartsWithTests branch September 27, 2015 02:01
@karelz karelz modified the milestone: 1.0.0-rtm Dec 3, 2016
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.

6 participants