mirror of
https://github.com/real-zony/ZonyLrcToolsX.git
synced 2025-07-01 20:30:41 +00:00
feat: Support newline configuration.
实装换行符配置项。
This commit is contained in:
parent
ed65790c43
commit
134d7eb5a0
@ -104,8 +104,8 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric
|
||||
public override string ToString()
|
||||
{
|
||||
var lyricBuilder = new StringBuilder();
|
||||
ForEach(lyric => lyricBuilder.Append(lyric).Append("\r\n"));
|
||||
return lyricBuilder.ToString().TrimEnd("\r\n");
|
||||
ForEach(lyric => lyricBuilder.Append(lyric).Append(Option.LineBreak));
|
||||
return lyricBuilder.ToString().TrimEnd(Option.LineBreak);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
using Shouldly;
|
||||
using Xunit;
|
||||
using ZonyLrcTools.Cli.Infrastructure.Lyric;
|
||||
|
||||
namespace ZonyLrcTools.Tests.Infrastructure.Lyric
|
||||
{
|
||||
public class LyricCollectionTests : TestBase
|
||||
{
|
||||
[Fact]
|
||||
public void LyricCollectionLineBreak_Test()
|
||||
{
|
||||
var lyricObject = new LyricItemCollection(new LyricItemCollectionOption
|
||||
{
|
||||
IsOneLine = false,
|
||||
LineBreak = LineBreakType.MacOs
|
||||
})
|
||||
{
|
||||
new(0, 20, "你好世界!"),
|
||||
new(0, 22, "Hello World!")
|
||||
};
|
||||
|
||||
lyricObject.ToString().ShouldContain(LineBreakType.MacOs);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user