Skip to content

Commit 79000c2

Browse files
committed
reworked tests
1 parent 3011ec4 commit 79000c2

File tree

4 files changed

+154
-172
lines changed

4 files changed

+154
-172
lines changed

tests/unit-tests/Tests/ReadOnlySpan/Split/SplitAny_StringSplitOptions/Tests.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ public void CountEqualDelimiterCountResultsInEverythingAfterAndIncludingLastDeli
183183
public void ConsecutiveDelimitersAtTheEndWithCountEqualDelimiterCountWithRemoveEmptyEntriesOptionResultInNoSpanWithDelimiter(StringSplitOptions options)
184184
{
185185
ReadOnlySpan<char> source = "aabc";
186-
186+
187187
char[][] expected = [['a', 'a']];
188-
188+
189189
var actual = source.SplitAny(['b', 'c'], 2, options).ToSystemEnumerable();
190190

191191
AssertEqual(expected, actual);
@@ -194,7 +194,7 @@ public void ConsecutiveDelimitersAtTheEndWithCountEqualDelimiterCountWithRemoveE
194194
[Fact]
195195
public void TrimEntriesOptionTrimsLastSpan()
196196
{
197-
ReadOnlySpan<char> source = "a b c a";
197+
ReadOnlySpan<char> source = "a b c a";
198198

199199
char[][] expected = [['a'], [], ['a']];
200200

@@ -209,7 +209,7 @@ public void WhiteSpaceSpanWithTrimEntriesAndRemoveEmptyEntriesOptionsReturnsNoth
209209
ReadOnlySpan<char> source = "\r \n \t";
210210

211211
char[][] expected = EmptyNestedCharArray;
212-
212+
213213
var actual = source.SplitAny(['_', '!'], StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries).ToSystemEnumerable();
214214

215215
AssertEqual(expected, actual);
@@ -224,7 +224,7 @@ public void ConsecutiveDelimitersAtTheEndWithRemoveEmptyEntriesOptionResultInNoE
224224

225225
var actual = source.SplitAny(['b', 'c'], StringSplitOptions.RemoveEmptyEntries).ToSystemEnumerable();
226226

227-
AssertEqual(expected, actual);
227+
AssertEqual(expected, actual);
228228
}
229229

230230
[Fact]
@@ -283,20 +283,20 @@ public void CountEqualOneWithRemoveEmptyEntriesAndTrimEntriesOptionsDoesNotRecur
283283
char[][] expected = [['b', '\t', 'a', 'a']];
284284

285285
var actual = source.SplitAny(['b', 'c'], 1, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries).ToSystemEnumerable();
286-
287-
AssertEqual(expected, actual);
286+
287+
AssertEqual(expected, actual);
288288
}
289289

290290
[Fact]
291291
public void CountGreaterThanOneWithRemoveEmptyEntriesAndTrimEntriesOptionsRecursivelyRemovesWhiteSpaceSpansAtTheStart()
292292
{
293293
ReadOnlySpan<char> source = " b\taa\n";
294294

295-
char[][] expected = [['a', 'a'] ];
295+
char[][] expected = [['a', 'a']];
296296

297297
var actual = source.SplitAny(['b', 'c'], 2, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries).ToSystemEnumerable();
298298

299-
AssertEqual(expected, actual);
299+
AssertEqual(expected, actual);
300300
}
301301

302302
[Theory]
@@ -306,8 +306,8 @@ public void EmptyDelimiterSpanResultsSameAsCountEqualOne(StringSplitOptions opti
306306
ReadOnlySpan<char> source = " ";
307307

308308
var expected = source.SplitAny([], 1, options).ToSystemEnumerable();
309-
310-
var actual = source.SplitAny([], options).ToSystemEnumerable( );
309+
310+
var actual = source.SplitAny([], options).ToSystemEnumerable();
311311

312312
AssertEqual(expected, actual);
313313
}

tests/unit-tests/Tests/ReadOnlySpan/Split/Split_StringSplitOptions/Data.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ public static TheoryData<StringSplitOptions, CountExceedingBehaviour, char> Coun
2121
{ StringSplitOptions.TrimEntries, CountExceedingBehaviour.AppendRemainingElements, 'a' },
2222
{ StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries, CountExceedingBehaviour.AppendRemainingElements, 'a' },
2323
};
24-
public static TheoryData<char[][], string, int, char[]> CountEqualDelimiterCountResultsInSpanWithEverythingAfterAndIncludingLastDelimiter_Data
25-
=> new TheoryData<char[][], string, int, char[]>
24+
public static TheoryData<char[][], string, int, char> CountEqualDelimiterCountResultsInSpanWithEverythingAfterAndIncludingLastDelimiter_Data
25+
=> new TheoryData<char[][], string, int, char>
2626
{
27-
{ new char[][] { ['a', 'a', 'b', 'c', 'a', 'a'] }, "aabcaa", 1, ['b', 'c'] },
28-
{ new char[][] { ['a', 'a'], ['a', 'a', 'b', 'c', 'a', 'a'] }, "aabcaabcaa", 2, ['b', 'c'] }
27+
{ new char[][] { ['a', 'a', 'b', 'c', 'a', 'a'] }, "aabcaa", 1, 'b' },
28+
{ new char[][] { ['a', 'a'], ['a', 'a', 'b', 'c', 'a', 'a'] }, "aabcaabcaa", 2, 'b' }
2929
};
30-
public static TheoryData<char[][], string, int, char[]> DelimiterAtTheEndWithCountEqualDelimiterCountResultsInSpanWithDelimiter_Data
31-
=> new TheoryData<char[][], string, int, char[]>
30+
public static TheoryData<char[][], string, int, char> DelimiterAtTheEndWithCountEqualDelimiterCountResultsInSpanWithDelimiter_Data
31+
=> new TheoryData<char[][], string, int, char>
3232
{
33-
{ new char[][] { ['a', 'a', 'b', 'c'] }, "aabc", 1, ['b', 'c'] },
34-
{ new char[][] { ['a', 'a'], ['a', 'b', 'c'] }, "aabcabc", 2, ['b', 'c'] }
33+
{ new char[][] { ['a', 'a', 'b', 'c'] }, "aabc", 1, 'b' },
34+
{ new char[][] { ['a', 'a'], ['a', 'b', 'c'] }, "aabcabc", 2, 'b' }
3535
};
36-
public static TheoryData<char[][], string, int, char[]> CountEqualDelimiterCountResultsInEverythingAfterAndIncludingLastDelimiterBeingCut_Data
37-
=> new TheoryData<char[][], string, int, char[]>
36+
public static TheoryData<char[][], string, int, char> CountEqualDelimiterCountResultsInEverythingAfterAndIncludingLastDelimiterBeingCut_Data
37+
=> new TheoryData<char[][], string, int, char>
3838
{
39-
{ new char[][] { ['a', 'a'] }, "aabcaa", 1, ['b', 'c'] },
40-
{ new char[][] { ['a', 'a'], ['a', 'a'] }, "aabcaabcaa", 2, ['b', 'c'] }
39+
{ new char[][] { ['a', 'a'] }, "aabaa", 1, 'b' },
40+
{ new char[][] { ['a', 'a'], ['a', 'a'] }, "aabaabcaa", 2, 'b' }
4141
};
4242
}
4343
}

0 commit comments

Comments
 (0)