Skip to content

Commit

Permalink
Tests for scope changes for variables and functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jgwilson42 authored and peterschrammel committed Jan 17, 2018
1 parent 8ee1956 commit e4a2763
Show file tree
Hide file tree
Showing 16 changed files with 153 additions and 4 deletions.
8 changes: 4 additions & 4 deletions regression/goto-diff/java-no-change/new/Test.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
public class Test {
public int foo(int x) {

private int foo(int x) {
if (x > 10) {
return x;
} else {
int y = x * 10;
return y;
return x * 10;
}
}

public int bar(int x) {
protected int bar(int x) {
if (x < 10) {
return x;
} else {
Expand Down
Binary file added regression/goto-diff/java-scope-change/new.jar
Binary file not shown.
18 changes: 18 additions & 0 deletions regression/goto-diff/java-scope-change/new/Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
public class Test {

private int foo(int x) {
if (x > 10) {
return x;
} else {
return x * 10;
}
}

protected int bar(int x) {
if (x < 10) {
return x;
} else {
return x / 10;
}
}
}
Binary file added regression/goto-diff/java-scope-change/old.jar
Binary file not shown.
18 changes: 18 additions & 0 deletions regression/goto-diff/java-scope-change/old/Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
public class Test {

public int foo(int x) {
if (x > 10) {
return x;
} else {
return x * 10;
}
}

public int bar(int x) {
if (x < 10) {
return x;
} else {
return x / 10;
}
}
}
11 changes: 11 additions & 0 deletions regression/goto-diff/java-scope-change/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CORE
new.jar
old.jar --json-ui
// Enable multi-line checking
activate-multi-line-match
EXIT=0
SIGNAL=0
"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": \[ \],
--
^warning: ignoring
--
Binary file added regression/goto-diff/java-scope-change2/new.jar
Binary file not shown.
20 changes: 20 additions & 0 deletions regression/goto-diff/java-scope-change2/new/Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
public class Test {

private int y = 5;

public int foo(int x) {
if (x > 10 && y > 5) {
return y;
} else {
return y * 10;
}
}

public int bar(int x) {
if (x < 10) {
return x;
} else {
return x / 10;
}
}
}
Binary file added regression/goto-diff/java-scope-change2/old.jar
Binary file not shown.
20 changes: 20 additions & 0 deletions regression/goto-diff/java-scope-change2/old/Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
public class Test {

public int y = 5;

public int foo(int x) {
if (x > 10 && y > 5) {
return y;
} else {
return y * 10;
}
}

public int bar(int x) {
if (x < 10) {
return x;
} else {
return x / 10;
}
}
}
11 changes: 11 additions & 0 deletions regression/goto-diff/java-scope-change2/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CORE
new.jar
old.jar --json-ui
// Enable multi-line checking
activate-multi-line-match
EXIT=0
SIGNAL=0
"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": \[ \],
--
^warning: ignoring
--
Binary file added regression/goto-diff/java-scope-change3/new.jar
Binary file not shown.
20 changes: 20 additions & 0 deletions regression/goto-diff/java-scope-change3/new/Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class Test {

public int y = 5;

public int foo(int x) {
if (x > 10 && y > 5) {
return y;
} else {
return y * 10;
}
}

public int bar(int x) {
if (x < 10) {
return x;
} else {
return x / 10;
}
}
}
Binary file added regression/goto-diff/java-scope-change3/old.jar
Binary file not shown.
20 changes: 20 additions & 0 deletions regression/goto-diff/java-scope-change3/old/Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
public class Test {

public int y = 5;

public int foo(int x) {
if (x > 10 && y > 5) {
return y;
} else {
return y * 10;
}
}

public int bar(int x) {
if (x < 10) {
return x;
} else {
return x / 10;
}
}
}
11 changes: 11 additions & 0 deletions regression/goto-diff/java-scope-change3/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CORE
new.jar
old.jar --json-ui
// Enable multi-line checking
activate-multi-line-match
EXIT=0
SIGNAL=0
"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": \[ \],
--
^warning: ignoring
--

0 comments on commit e4a2763

Please sign in to comment.