-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
toHaveElementsAndAll + feature produces non-grouped output #1357
Comments
if I use expect(listOf(Throwable("hello"))) {
toHaveElementsAndAll {
message {
toContain("world")
}
}
} =>
|
val <T : Throwable> Expect<T>.message: Expect<String>
get() = feature(Throwable::message).notToEqualNull()
...
inline fun <reified T : Any> Expect<T?>.notToEqualNull(): Expect<T> =
notToEqualNullButToBeAnInstanceOf(T::class).transform() |
The feature name is printed several times due to atrium/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/creating/impl/FeatureExpectImpl.kt Lines 61 to 80 in 65227ad
|
Thanks for your report. I see most things you have already figured out yourself. For:
the » bullet point signifies an explanation of an expectation.
I thought I already created an issue but apparently I only had it in my head. Regarding the grouping. We could already improve the implementation whenever the fail fast syntax is used within an expectation group. But we shouldn't do it in all cases IMO. I think it would make sense if the feature appears in sequence .
However, I wouldn't do it in the following case
I guess there is a reason why one chooses to split it this way. i.e. in reporting I would show:
I guess we would need a compiler plugin for the fail-fast use case:
which would be turned into something like
The benefit of it would be that you always see the subsequent expectations you defined in reporting, regardless if you use fail-fast or non-fail-fast semantic |
closing this as it entails multiple different aspects which are all covered in other issues:
|
Affected Version
0.18.0
API
fluent-en_GB
Platform
jvm
Kotlin Version
1.8
How to reproduce the problem?
Describe the bug
There seem to be several issues:
message:
branch is duplicated in the output.Expected behaviour
I think
to be an instance of type
should not be displayed, and, in case it is displayed, it should be rendered under a commonmessage:
group like inThis looks much better:
=>
The text was updated successfully, but these errors were encountered: