You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function is very useful but unfortunately Java introspection seems to have its own ideas about naming, so that properties are not ignored when their name starts with a lowercase letter immediately followed by an uppercase letter:
class PropertiesDemo {
data class Bean(
val lowercase: String,
val camelCase: String,
val bRoken: String,
)
val bean = Bean("bean", "bean", "bean")
@Test
fun camelCase() {
val copied = bean.copy(camelCase = "different")
expectThat(copied).propertiesAreEqualToIgnoring(bean, Bean::camelCase)
}
@Test
fun lowerCase() {
val copied = bean.copy(lowercase = "different")
expectThat(copied).propertiesAreEqualToIgnoring(bean, Bean::lowercase)
}
@Test
fun bRoken() {
val copied = bean.copy(bRoken = "different")
expectThat(copied).propertiesAreEqualToIgnoring(bean, Bean::bRoken)
}
}
When you run the above tests, you'll find that strikt sees the property Bean::bRoken as "BRoken" and therefore does not ignore it and fails the test.
The text was updated successfully, but these errors were encountered:
The function is very useful but unfortunately Java introspection seems to have its own ideas about naming, so that properties are not ignored when their name starts with a lowercase letter immediately followed by an uppercase letter:
When you run the above tests, you'll find that strikt sees the property Bean::bRoken as "BRoken" and therefore does not ignore it and fails the test.
The text was updated successfully, but these errors were encountered: