Skip to content

Commit

Permalink
feat: <java> add basic extend support
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Feb 8, 2020
1 parent 3164a7f commit b54e774
Showing 1 changed file with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,32 @@ package chapi.ast.javaast;
import hello.Expandable;
class IntegerArray implements Expandable<Integer> {
class IntegerArray implements Expandable {
void addItem(Integer item) {
}
}
"""
val codeFile = JavaFullIdent().identBasicInfo(code, "basic")
kotlin.test.assertEquals(codeFile.DataStructures.size, 1)
kotlin.test.assertEquals(codeFile.DataStructures[0].NodeName, "IntegerArray")
kotlin.test.assertEquals(codeFile.DataStructures[0].Implements[0], "Expandable")
}

@Test
internal fun shouldIdentifyExtends() {
val code = """
package chapi.ast.javaast;
import hello.Expandable;
class IntegerArray extends Expandable {
void addItem(Integer item) {
}
}
"""
val codeFile = JavaFullIdent().identBasicInfo(code, "basic")
kotlin.test.assertEquals(codeFile.DataStructures.size, 1)
kotlin.test.assertEquals(codeFile.DataStructures[0].NodeName, "IntegerArray")
kotlin.test.assertEquals(codeFile.DataStructures[0].Extend, "Expandable")
}
}

0 comments on commit b54e774

Please # to comment.