mirror of
https://github.com/ppy/osu.git
synced 2025-03-07 01:07:20 +08:00
Tests for the line-buffered reader added in 7b1ff38 were subtly dependent on the execution environment due to differing end-of-line markers on Windows and Unix-based systems. Because StreamReader discards all newlines when reading line-by-line, LineBufferedReader used a StringBuilder to patch the peeked lines back together with the remaining contents of the file being read. As StringBuilder.AppendLine uses the environment-specific newline delimiter, the delimiters after the peeked-but-unconsumed lines can therefore be substituted by the platform-specific variants, causing the test failures due to the overly-simplified way they were written. Reformulate the test to avoid such issues from resurfacing again by splitting lines by \r or \n and then testing each line individually. Additionally remove all raw literals in favour of explicitly mixing various line delimiter character sequences for additional coverage.