public void LookAheadReturnsNothingWhenOutOfRange() { //Arrange var input = "123"; var scanState = new SourceScanState(input.AsMemory()); //Act scanState.LookAhead(4).IsEmpty.Should().BeTrue(); }
public void LookAheadReturnsStuff() { //Arrange var input = "123"; var scanState = new SourceScanState(input.AsMemory()); //Act scanState.LookAhead(2).ToArray().Should().BeEquivalentTo(new[] { '1', '2' }); }
public void LookAheadWhenAtEndReturnsEmpty() { //Arrange var input = "123"; var scanState = new SourceScanState(input.AsMemory()); scanState.Advance(); scanState.Advance(); scanState.Advance(); //Act & Assert scanState.LookAhead(2).IsEmpty.Should().BeTrue(); }