Fix numbering in debugger tests
Line number in SourcePosition is actually 0-based
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user