Skip to content

The code has been executed, but the previous sentence shows that it has not been overwritten #762

@Lxiaoqiang

Description

@Lxiaoqiang

Describe the bug
The code at the back has been covered, but the previous sentence has not been covered

Expected behavior
This is the ut code:

@test
fun test add and remove callback() {
val helper = XMLYMediaBrowserHelper()
val callback = mockk<XMLYMediaBrowserHelper.Callback>()
helper.addCallback(callback)
val callbacks = getPrivateField(helper, "callbacks").get(helper) as List<*>
assert(callbacks.contains(callback))
//again and assert
helper.addCallback(callback)
assert(callbacks.size == 1)
//remove
helper.removeCallback(callback)
assert(!callbacks.contains(callback))
}

Reports

Image

Environment

  • Kover Gradle Plugin version: 0.9.2
  • Gradle version: 8.11.1
  • Kotlin project type: Kotlin/Android

Metadata

Metadata

Assignees

Labels

BugBug issue typeS: waiting for clarificationStatus: additional information required to proceed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions