CodeWalker/CodeWalker.Test/TestSpanLineEnumerator.cs
Niek Schoemaker 8c2e444049
Update to .NET 6
Added Span support in some places already, and changed Nullable to annotations to declare intent to enable nullable at some point in the future
2023-11-14 16:16:59 +01:00

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());
}
}
}
}