public void PropertiesTest() { SigoAssert.Equal(-1, lexer.Min); SigoAssert.Equal(2, lexer.Max); SigoAssert.Equal(0, lexer.Cursor); lexer.Move(2); SigoAssert.Equal(2, lexer.Cursor); SigoAssert.Equal("2", lexer.Peek(0).Raw); lexer.Move(2); SigoAssert.Equal(4, lexer.Cursor); SigoAssert.Equal("4", lexer.Peek(0).Raw); lexer.Peek(lexer.Max); // after peek max, you can Move min, but not min-1 lexer.Move(-1); SigoAssert.Equal(3, lexer.Cursor); SigoAssert.Equal("3", lexer.Peek(0).Raw); SigoAssert.ThrowsAny <Exception>(() => lexer.Peek(-1)); // after move(-1) you have limitation SigoAssert.ThrowsAny <Exception>(() => lexer.Move(-1)); }
private void Next() { lexer.Move(1); t = lexer.Peek(0); }