Fix numbering in debugger tests

Line number in SourcePosition is actually 0-based
This commit is contained in:
Alexander Udalov
2012-10-19 21:12:45 +04:00
parent 3ce4d68c3b
commit 1469c1fe5e
3 changed files with 8 additions and 3 deletions
+2
View File
@@ -0,0 +1,2 @@
class A { fun f() {} } // A
class B { fun g() {} } // B
@@ -117,4 +117,8 @@ public class JetPositionManagerTest extends PositionManagerTestCase {
public void testTrait() {
doTest();
}
public void testTwoClasses() {
doTest();
}
}
@@ -122,8 +122,7 @@ public abstract class PositionManagerTestCase extends MultiFileTestCase {
for (int i = 0; i < lines.length; i++) {
Matcher matcher = BREAKPOINT_PATTERN.matcher(lines[i]);
if (matcher.matches()) {
// Line breakpoint numbers are 1-based
breakpoints.add(new Breakpoint(file, i + 1, matcher.group(1)));
breakpoints.add(new Breakpoint(file, i, matcher.group(1)));
}
}
@@ -168,7 +167,7 @@ public abstract class PositionManagerTestCase extends MultiFileTestCase {
private static class Breakpoint {
private final JetFile file;
private final int lineNumber;
private final int lineNumber; // 0-based
private final String className;
private Breakpoint(JetFile file, int lineNumber, String className) {