Skip to content

Commit e4a2763

Browse files
jgwilson42peterschrammel
jgwilson42
authored andcommitted
Tests for scope changes for variables and functions
1 parent 8ee1956 commit e4a2763

File tree

16 files changed

+153
-4
lines changed

16 files changed

+153
-4
lines changed

regression/goto-diff/java-no-change/new/Test.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
public class Test {
2-
public int foo(int x) {
2+
3+
private int foo(int x) {
34
if (x > 10) {
45
return x;
56
} else {
6-
int y = x * 10;
7-
return y;
7+
return x * 10;
88
}
99
}
1010

11-
public int bar(int x) {
11+
protected int bar(int x) {
1212
if (x < 10) {
1313
return x;
1414
} else {
698 Bytes
Binary file not shown.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
public class Test {
2+
3+
private int foo(int x) {
4+
if (x > 10) {
5+
return x;
6+
} else {
7+
return x * 10;
8+
}
9+
}
10+
11+
protected int bar(int x) {
12+
if (x < 10) {
13+
return x;
14+
} else {
15+
return x / 10;
16+
}
17+
}
18+
}
697 Bytes
Binary file not shown.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
public class Test {
2+
3+
public int foo(int x) {
4+
if (x > 10) {
5+
return x;
6+
} else {
7+
return x * 10;
8+
}
9+
}
10+
11+
public int bar(int x) {
12+
if (x < 10) {
13+
return x;
14+
} else {
15+
return x / 10;
16+
}
17+
}
18+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CORE
2+
new.jar
3+
old.jar --json-ui
4+
// Enable multi-line checking
5+
activate-multi-line-match
6+
EXIT=0
7+
SIGNAL=0
8+
"deletedFunctions": \[ \],\n "modifiedFunctions": \[\n {\n "name": "java::Test\.foo:\(I\)I",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.foo:\(I\)I",\n "line": "4"\n }\n },\n {\n "name": "java::Test\.bar:\(I\)I",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.bar:\(I\)I",\n "line": "12"\n }\n }\n \],\n "newFunctions": \[ \],
9+
--
10+
^warning: ignoring
11+
--
738 Bytes
Binary file not shown.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
public class Test {
2+
3+
private int y = 5;
4+
5+
public int foo(int x) {
6+
if (x > 10 && y > 5) {
7+
return y;
8+
} else {
9+
return y * 10;
10+
}
11+
}
12+
13+
public int bar(int x) {
14+
if (x < 10) {
15+
return x;
16+
} else {
17+
return x / 10;
18+
}
19+
}
20+
}
738 Bytes
Binary file not shown.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
public class Test {
2+
3+
public int y = 5;
4+
5+
public int foo(int x) {
6+
if (x > 10 && y > 5) {
7+
return y;
8+
} else {
9+
return y * 10;
10+
}
11+
}
12+
13+
public int bar(int x) {
14+
if (x < 10) {
15+
return x;
16+
} else {
17+
return x / 10;
18+
}
19+
}
20+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CORE
2+
new.jar
3+
old.jar --json-ui
4+
// Enable multi-line checking
5+
activate-multi-line-match
6+
EXIT=0
7+
SIGNAL=0
8+
"deletedFunctions": \[ \],\n "modifiedFunctions": \[\n {\n "name": "java::Test\.<init>:\(\)V",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.<init>:\(\)V",\n "line": "1"\n }\n },\n {\n "name": "java::Test\.foo:\(I\)I",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.foo:\(I\)I",\n "line": "6"\n }\n },\n {\n "name": "java::Test\.bar:\(I\)I",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.bar:\(I\)I",\n "line": "14"\n }\n }\n \],\n "newFunctions": \[ \],
9+
--
10+
^warning: ignoring
11+
--
455 Bytes
Binary file not shown.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
class Test {
2+
3+
public int y = 5;
4+
5+
public int foo(int x) {
6+
if (x > 10 && y > 5) {
7+
return y;
8+
} else {
9+
return y * 10;
10+
}
11+
}
12+
13+
public int bar(int x) {
14+
if (x < 10) {
15+
return x;
16+
} else {
17+
return x / 10;
18+
}
19+
}
20+
}
738 Bytes
Binary file not shown.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
public class Test {
2+
3+
public int y = 5;
4+
5+
public int foo(int x) {
6+
if (x > 10 && y > 5) {
7+
return y;
8+
} else {
9+
return y * 10;
10+
}
11+
}
12+
13+
public int bar(int x) {
14+
if (x < 10) {
15+
return x;
16+
} else {
17+
return x / 10;
18+
}
19+
}
20+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CORE
2+
new.jar
3+
old.jar --json-ui
4+
// Enable multi-line checking
5+
activate-multi-line-match
6+
EXIT=0
7+
SIGNAL=0
8+
"deletedFunctions": \[ \],\n "modifiedFunctions": \[\n {\n "name": "java::Test\.<init>:\(\)V",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.<init>:\(\)V",\n "line": "1"\n }\n },\n {\n "name": "java::Test\.foo:\(I\)I",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.foo:\(I\)I",\n "line": "6"\n }\n },\n {\n "name": "java::Test\.bar:\(I\)I",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.bar:\(I\)I",\n "line": "14"\n }\n }\n \],\n "newFunctions": \[ \],
9+
--
10+
^warning: ignoring
11+
--

0 commit comments

Comments
 (0)