Skip to content

Commit

Permalink
(WIP) add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Godin committed Dec 17, 2020
1 parent cddf72e commit 9830335
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,37 @@ public void should_not_filter_when_invokestatic_owner_does_not_match() {
assertIgnored();
}

/**
* <pre>
* interface I {
* fun m1() = Unit
* fun m2() = Unit
* }
*
* class C : I {
* // Should not be filtered:
* override fun m1() {
* super.m2()
* }
* }
* </pre>
*/
@Test
public void should_not_filter_when_invokestatic_name_does_not_match() {
context.classAnnotations
.add(KotlinGeneratedFilter.KOTLIN_METADATA_DESC);
final MethodNode m = new MethodNode(InstrSupport.ASM_API_VERSION, 0,
"m1", "()V", null, null);
m.visitVarInsn(Opcodes.ALOAD, 0);
m.visitMethodInsn(Opcodes.INVOKESTATIC, "I$DefaultImpls", "m2", "(LI;)V",
false);
m.visitInsn(Opcodes.RETURN);

filter.filter(m, context, output);

assertIgnored();
}

@Test
public void should_not_filter_when_instructions_do_not_match() {
context.classAnnotations
Expand Down

0 comments on commit 9830335

Please sign in to comment.