* Creates a sample position map and checks several points.
*/
@Test
public void basicTest() throws CannotAddException {
SourcePositionMapBuilder builder = new PositionMapBuilderImpl();
builder.addMapping(new ResourceSection(new VmResourceId("source1.js", null), 0, 0, 5, 0),
new ResourceSection(new VmResourceId("compiled.js", null), 0, 0, 1, 0),
new TextSectionMappingImpl(
new StringMappingData(new int [] { 0,0, 1,0, 2,0, 3,0, 4,0 } , 5, 0),
new StringMappingData(new int [] { 0,0, 0,10, 0,20, 0,30, 0,40 }, 0, 50)));
builder.addMapping(new ResourceSection(new VmResourceId("source2.js", null), 0, 0, 5, 0),
new ResourceSection(new VmResourceId("compiled.js", null), 1, 0, 2, 0),
new TextSectionMappingImpl(
new StringMappingData(new int [] { 0,0, 1,0, 2,0, 3,0, 4,0}, 5, 0),
new StringMappingData(new int [] { 1,0, 1,10, 1,20, 1,30, 1,40}, 1, 50)));
builder.addMapping(new ResourceSection(new VmResourceId("source3.js", null), 0, 0, 5, 0),
new ResourceSection(new VmResourceId("compiled.js", null), 2, 0, 3, 0),
new TextSectionMappingImpl(
new StringMappingData(new int [] {0,0, 1,0, 2,0, 3,0, 4,0}, 5, 0),
new StringMappingData(new int [] {2,0, 2,10, 2,20, 2,30, 2,40}, 2, 50)));
SourcePositionMap map = builder.getSourcePositionMap();