aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorakuznetsov <akuznetsov@tradingview.com>2023-12-29 17:29:28 +0400
committerakuznetsov <akuznetsov@tradingview.com>2023-12-29 17:29:28 +0400
commit9777bae93cc84249fe08a7e81b2101c415bd55e5 (patch)
tree64fb183df9171cf231e3429fa6248706d2af9105 /src/test
parent0824a7a04e2f5ca8acc355c2379cf625dadc8943 (diff)
downloadjavassist-9777bae93cc84249fe08a7e81b2101c415bd55e5.tar.gz
javassist-9777bae93cc84249fe08a7e81b2101c415bd55e5.zip
line numbers for undefined ids & more
Diffstat (limited to 'src/test')
-rw-r--r--src/test/javassist/LineNumberTest.java14
-rw-r--r--src/test/javassist/compiler/CompTest.java4
2 files changed, 16 insertions, 2 deletions
diff --git a/src/test/javassist/LineNumberTest.java b/src/test/javassist/LineNumberTest.java
index 158efd01..7e9fbd2f 100644
--- a/src/test/javassist/LineNumberTest.java
+++ b/src/test/javassist/LineNumberTest.java
@@ -13,6 +13,20 @@ public class LineNumberTest extends TestCase {
"}"), "line 3: syntax error near \" return\n}\"");
}
+ public void testUndevField() {
+ doTestCompile(String.join("\n",
+ "public void run() {",
+ " foo = 5;",
+ "}"), "line 2: no such field: foo");
+ }
+
+ public void testUndevMethod() {
+ doTestCompile(String.join("\n",
+ "public void run() {",
+ " foo();",
+ "}"), "line 2: foo() not found in javassist.LineNumberCompileTest2");
+ }
+
public void testException() {
doTestRuntime(String.join("\n",
"public void run() {",
diff --git a/src/test/javassist/compiler/CompTest.java b/src/test/javassist/compiler/CompTest.java
index 4154935f..5774f7aa 100644
--- a/src/test/javassist/compiler/CompTest.java
+++ b/src/test/javassist/compiler/CompTest.java
@@ -105,11 +105,11 @@ public class CompTest extends TestCase {
public void testArgTypesToString() {
String s;
- s = TypeChecker.argTypesToString(new int[0], new int[0], new String[0]);
+ s = TypeChecker.argTypesToString(new int[0], new int[0], new String[0], 0);
assertEquals("()", s);
s = TypeChecker.argTypesToString(new int[] { TokenId.INT, TokenId.CHAR, TokenId.CLASS },
new int[] { 0, 1, 0 },
- new String[] { null, null, "String" });
+ new String[] { null, null, "String" }, 0);
assertEquals("(int,char[],String)", s);
}