Skip to content

Commit f3c98a6

Browse files
authored
Diamond tests adjustment (#2345)
* Updated DiamondTests.cs `Rows` method adjusted to use system dependent new line characters. * DiamondTests.Rows method adjusted to be line-ending tolerant.
1 parent 3bc3370 commit f3c98a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

exercises/practice/diamond/DiamondTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
public class DiamondTests
88
{
99
public static readonly char[] AllLetters = GetLetterRange('A', 'Z');
10-
private static string[] Rows(string x) => x.Split(new[] { '\n' }, StringSplitOptions.None);
10+
private static string[] Rows(string x) => x.Split('\n').Select(line => line.TrimEnd('\r')).ToArray();
1111

1212
private static string LeadingSpaces(string x) => x.Substring(0, x.IndexOfAny(AllLetters));
1313
private static string TrailingSpaces(string x) => x.Substring(x.LastIndexOfAny(AllLetters) + 1);
@@ -125,4 +125,4 @@ public static Arbitrary<char> Chars()
125125
{
126126
return Arb.Default.Char().Filter(x => x >= 'A' && x <= 'Z');
127127
}
128-
}
128+
}

0 commit comments

Comments
 (0)