mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-16 20:17:30 +08:00
8c2e444049
Added Span support in some places already, and changed Nullable to annotations to declare intent to enable nullable at some point in the future
32 lines
734 B
C#
32 lines
734 B
C#
using CodeWalker.Core.Utils;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Xunit;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace CodeWalker.Test
|
|
{
|
|
public class TestSpanLineEnumerator
|
|
{
|
|
private readonly ITestOutputHelper output;
|
|
public TestSpanLineEnumerator(ITestOutputHelper output)
|
|
{
|
|
this.output = output;
|
|
}
|
|
|
|
[Fact]
|
|
public void IteratorShouldSplitLinesCorrectly()
|
|
{
|
|
var lines = "kaas\nsaak\nnog\neen\nline".AsSpan();
|
|
|
|
foreach(var line in lines.EnumerateSplit('\n'))
|
|
{
|
|
output.WriteLine(line.ToString());
|
|
}
|
|
}
|
|
}
|
|
}
|