mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2026-01-29 06:01:03 +00:00
test: improve PatcherTest
This commit is contained in:
@@ -7,4 +7,14 @@ object ASMWriter {
|
||||
fun InsnList.setAt(index: Int, node: AbstractInsnNode) {
|
||||
this[this.get(index)] = node
|
||||
}
|
||||
fun InsnList.insertAt(index: Int, vararg nodes: AbstractInsnNode) {
|
||||
this.insert(this.get(index), nodes.toInsnList())
|
||||
}
|
||||
|
||||
// TODO(Sculas): Should this be public?
|
||||
private fun Array<out AbstractInsnNode>.toInsnList(): InsnList {
|
||||
val list = InsnList()
|
||||
this.forEach { list.add(it) }
|
||||
return list
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user