Repository navigation
Tests for new string.contains Api - #25448
Conversation
|
Please use a better title eg "Tests for new String.Contains API" |
|
Looks good but needs tests for the other 2 api |
| public static void Contains(string s, char value, StringComparison comparisionType, bool expected) | ||
| { | ||
| Assert.Equal(expected, s.Contains(value, comparisionType)); | ||
| } |
There was a problem hiding this comment.
These tests are for new APIs and will fail to compile here when building against netstandard. They should be moved to StringTests.netcoreapp.cs.
| public static string Concat(params string[] values) { throw null; } | ||
| public static string Concat<T>(System.Collections.Generic.IEnumerable<T> values) { throw null; } | ||
| public bool Contains(string value) { throw null; } | ||
| public bool Contains(char value) { throw null; } |
There was a problem hiding this comment.
Nit: please sort : c comes before s.
|
@dotnet-bot test this please |
|
@Anipik the UWP builds is failing because the API is not ported into CoreRt. Please add the implementation in the CoreRt repo like you did in coreclr. |
|
@danmosemsft |
|
Ah..its shared, you're right. The issue then is it needs to mirror again into the project N branch which might take a few days. You can just sit on this PR and wait for that. |
|
@dotnet-bot test this please |
| public override int GetHashCode() { throw null; } | ||
| public int GetHashCode(System.StringComparison comparisonType) { throw null; } | ||
| public int IndexOf(char value) { throw null; } | ||
| public int IndexOf(char value, StringComparison comparisonType) { throw null; } |
There was a problem hiding this comment.
Are there tests for this new IndexOf overload?
There was a problem hiding this comment.
I missed them. Can you point me to them?
There was a problem hiding this comment.
src/System.Runtime/tests/System/StringTests.netcoreapp.cs
There was a problem hiding this comment.
I’m sorry I can’t seem to find them. I must be missing something. Can you provide a direct link? I see the new Contains tests you added, but no tests for the new IndexOf overload.
There was a problem hiding this comment.
Sorry you are right. I am not testing indexof. I will add tests
There was a problem hiding this comment.
@stephentoub should they be added to stringtests.cs or stringtests.netcoreapp.cs?
There was a problem hiding this comment.
should they be added to stringtests.cs or stringtests.netcoreapp.cs?
They won't compile if they're added to StringTests.cs. They should be added to StringTests.netcoreapp.cs.
|
@Anipik as a general rule please wait for at least one "green checkmark" signoff before merging. (My "Looks good but needs tests for the other 2 api" may have been confusing) |
* Changes * Tests updated * string comparision overload added * Moved to stringtestsnetcoreapp * sorted alphabetically in ref file Commit migrated from dotnet/corefx@cba0e2b
Fixes #25094
PR implementation link = dotnet/coreclr#15180