Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isEqualToIgnoringGivenProperties does not check private fields #548

Open
ajax-maltsev-k opened this issue Oct 16, 2024 · 0 comments
Open

Comments

@ajax-maltsev-k
Copy link

ajax-maltsev-k commented Oct 16, 2024

data class Obj(val publicStr: String, private val privateStr: String)

@Test
fun t() {
    val obj1 = Obj("public", "private1")
    val obj2 = Obj("public", "private2")

    assertThat(obj1).isEqualToIgnoringGivenProperties(obj2, MyClass::publicStr)
}

This test results in successful assertion, despite that private fields values is different.

assertkVer: 0.28.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant