22 lines
521 B
C#
22 lines
521 B
C#
|
using CanonSharp.Combinator.Extensions;
|
||
|
using CanonSharp.Common.Scanner;
|
||
|
|
||
|
namespace CanonSharp.Tests.LexicalAnalyzerTests;
|
||
|
|
||
|
public class StringReadStateTests
|
||
|
{
|
||
|
[Fact]
|
||
|
public void AsEnumerableTest()
|
||
|
{
|
||
|
StringReadState state = new("abc");
|
||
|
|
||
|
IEnumerable<StringReadState> states = state.AsEnumerable<char, StringReadState>();
|
||
|
|
||
|
foreach ((char c, StringReadState s) in "abc".Zip(states))
|
||
|
{
|
||
|
Assert.True(s.HasValue);
|
||
|
Assert.Equal(c, s.Current);
|
||
|
}
|
||
|
}
|
||
|
}
|