1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 20:22:55 +08:00
osu-lazer/osu.Game.Tests/Beatmaps/IO
Bartłomiej Dach cb1f7e2dc7 Fix platform dependency in buffered reader test
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.
2019-10-10 15:33:18 +02:00
..
ImportBeatmapTest.cs Merge branch 'master' into beatmap-parsing-fallback-v2 2019-10-03 15:12:21 +08:00
LineBufferedReaderTest.cs Fix platform dependency in buffered reader test 2019-10-10 15:33:18 +02:00
OszArchiveReaderTest.cs Migrate decoding to line-buffered reader 2019-09-15 01:28:07 +02:00