Examples of lineForOffset()


Examples of net.sf.lapg.parser.LapgTree.TextSource.lineForOffset()

  public void testTextSource() {
    TextSource source = new TextSource("file", "aa\nbb\n\nc".toCharArray(), 7);
    int[] expected = new int[] { 7, 7, 7, 8, 8, 8, 9, 10 };

    for (int i = 0; i < expected.length; i++) {
      Assert.assertEquals("offset #" + i, expected[i], source.lineForOffset(i));
    }
  }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.