mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 03:13:21 +08:00
Merge branch 'master' into ignore-macosx-folder-in-archives
This commit is contained in:
commit
c7eb0b401b
@ -62,6 +62,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.913.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.913.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2019.1010.0" />
|
<PackageReference Include="ppy.osu.Framework.Android" Version="2019.1011.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
@ -14,9 +15,7 @@ namespace osu.Game.Tests.Beatmaps.IO
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestReadLineByLine()
|
public void TestReadLineByLine()
|
||||||
{
|
{
|
||||||
const string contents = @"line 1
|
const string contents = "line 1\rline 2\nline 3";
|
||||||
line 2
|
|
||||||
line 3";
|
|
||||||
|
|
||||||
using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(contents)))
|
using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(contents)))
|
||||||
using (var bufferedReader = new LineBufferedReader(stream))
|
using (var bufferedReader = new LineBufferedReader(stream))
|
||||||
@ -31,9 +30,7 @@ line 3";
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestPeekLineOnce()
|
public void TestPeekLineOnce()
|
||||||
{
|
{
|
||||||
const string contents = @"line 1
|
const string contents = "line 1\r\npeek this\nline 3";
|
||||||
peek this
|
|
||||||
line 3";
|
|
||||||
|
|
||||||
using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(contents)))
|
using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(contents)))
|
||||||
using (var bufferedReader = new LineBufferedReader(stream))
|
using (var bufferedReader = new LineBufferedReader(stream))
|
||||||
@ -49,9 +46,7 @@ line 3";
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestPeekLineMultipleTimes()
|
public void TestPeekLineMultipleTimes()
|
||||||
{
|
{
|
||||||
const string contents = @"peek this once
|
const string contents = "peek this once\nline 2\rpeek this a lot";
|
||||||
line 2
|
|
||||||
peek this a lot";
|
|
||||||
|
|
||||||
using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(contents)))
|
using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(contents)))
|
||||||
using (var bufferedReader = new LineBufferedReader(stream))
|
using (var bufferedReader = new LineBufferedReader(stream))
|
||||||
@ -70,8 +65,7 @@ peek this a lot";
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestPeekLineAtEndOfStream()
|
public void TestPeekLineAtEndOfStream()
|
||||||
{
|
{
|
||||||
const string contents = @"first line
|
const string contents = "first line\r\nsecond line";
|
||||||
second line";
|
|
||||||
|
|
||||||
using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(contents)))
|
using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(contents)))
|
||||||
using (var bufferedReader = new LineBufferedReader(stream))
|
using (var bufferedReader = new LineBufferedReader(stream))
|
||||||
@ -100,8 +94,7 @@ second line";
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestReadToEndNoPeeks()
|
public void TestReadToEndNoPeeks()
|
||||||
{
|
{
|
||||||
const string contents = @"first line
|
const string contents = "first line\r\nsecond line";
|
||||||
second line";
|
|
||||||
|
|
||||||
using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(contents)))
|
using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(contents)))
|
||||||
using (var bufferedReader = new LineBufferedReader(stream))
|
using (var bufferedReader = new LineBufferedReader(stream))
|
||||||
@ -113,20 +106,19 @@ second line";
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestReadToEndAfterReadsAndPeeks()
|
public void TestReadToEndAfterReadsAndPeeks()
|
||||||
{
|
{
|
||||||
const string contents = @"this line is gone
|
const string contents = "this line is gone\rthis one shouldn't be\r\nthese ones\ndefinitely not";
|
||||||
this one shouldn't be
|
|
||||||
these ones
|
|
||||||
definitely not";
|
|
||||||
|
|
||||||
using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(contents)))
|
using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(contents)))
|
||||||
using (var bufferedReader = new LineBufferedReader(stream))
|
using (var bufferedReader = new LineBufferedReader(stream))
|
||||||
{
|
{
|
||||||
Assert.AreEqual("this line is gone", bufferedReader.ReadLine());
|
Assert.AreEqual("this line is gone", bufferedReader.ReadLine());
|
||||||
Assert.AreEqual("this one shouldn't be", bufferedReader.PeekLine());
|
Assert.AreEqual("this one shouldn't be", bufferedReader.PeekLine());
|
||||||
const string ending = @"this one shouldn't be
|
|
||||||
these ones
|
var endingLines = bufferedReader.ReadToEnd().Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
definitely not";
|
Assert.AreEqual(3, endingLines.Length);
|
||||||
Assert.AreEqual(ending, bufferedReader.ReadToEnd());
|
Assert.AreEqual("this one shouldn't be", endingLines[0]);
|
||||||
|
Assert.AreEqual("these ones", endingLines[1]);
|
||||||
|
Assert.AreEqual("definitely not", endingLines[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.913.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.913.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2019.1010.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2019.1011.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.24.0" />
|
<PackageReference Include="SharpCompress" Version="0.24.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
|
@ -118,12 +118,12 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.913.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.913.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2019.1010.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2019.1011.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.1010.0" />
|
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.1011.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.24.0" />
|
<PackageReference Include="SharpCompress" Version="0.24.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.11.0" />
|
<PackageReference Include="NUnit" Version="3.11.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
<PackageReference Include="System.ComponentModel.Annotations" Version="4.6.0" />
|
<PackageReference Include="System.ComponentModel.Annotations" Version="4.6.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.NativeLibs" Version="2019.1010.0" ExcludeAssets="all" />
|
<PackageReference Include="ppy.osu.Framework.NativeLibs" Version="2019.1011.0" ExcludeAssets="all" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
Loading…
Reference in New Issue
Block a user