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
Affected Version: 1.7 API (fluent-en_GB, infix-en_GB): both Platform (jvm, js): logic Extension (none, kotlin 1.3): none
expect(oneToSeven()).notToContainFun({})
produces
"expected that subject: kotlin.sequences.SequencesKt___SequencesKt$asIterable$$inlined$Iterable$1@5453dabb (kotlin.sequences.SequencesKt___SequencesKt$asIterable$$inlined$Iterable$1 <1414781627>)
◆ does not contain:
⚬ an element which:
» at least one assertion defined: false
» You forgot to define assertions in the assertionCreator-lambda
» Sometimes you can use an alternative to `{ }` For instance, instead of `toThrow<..> { }` you should use `toThrow<..>()`
✔ ▶ number of such entries: 0
◾ is: 0 (kotlin.Int <449752083>)
✔ ▶ has at least one element: true
◾ is: true
✘ at least one assertion defined: false
» You forgot to define assertions in the assertionCreator-lambda
» Sometimes you can use an alternative to `{ }` For instance, instead of `toThrow<..> { }` you should use `toThrow<..>()`"
expected that subject: kotlin.sequences.SequencesKt___SequencesKt$asIterable$$inlined$Iterable$1@1b2be2e2 (kotlin.sequences.SequencesKt___SequencesKt$asIterable$$inlined$Iterable$1 <455860962>)
◆ does not contain:
⚬ an element which:
» at least one assertion defined: false
» You forgot to define assertions in the assertionCreator-lambda
» Sometimes you can use an alternative to `{ }` For instance, instead of `toThrow<..> { }` you should use `toThrow<..>()`
✔ ▶ number of such entries: 0
◾ is: 0 (kotlin.Int <449752083>)
✔ ▶ has at least one element: true
◾ is: true
✘ at least one assertion defined: false
» You forgot to define assertions in the assertionCreator-lambda
» Sometimes you can use an alternative to `{ }` For instance, instead of `toThrow<..> { }` you should use `toThrow<..>()`
⚬ an element which:
» is less than: 3.0 (kotlin.Double <888510275>)
✘ ▶ number of such entries: 2
◾ is: 0 (kotlin.Int <449752083>)
✔ ▶ has at least one element: true
◾ is: true
Describe the bug
On IterableLike notToContain.entry/entries the empty assertionCreator lambda is getting added twice. In InAnyOrderEntriesAssertionCreator it appears to be getting added once in addEmptyAssertionCreatorLambdaIfNeccessaryand once in createExplanatoryAssertionGroup.
Good catch. I am going to remove bug as it is not something which needs to be fixed immediately IMO and thus change it to enhancement.
I am not even sure if we should fix it / invest time for it, knowing that this only occurs if the developer has forgotten to specify assertions.
In case someone is motivated to fix it, then go for it. But I think we should reduce it to a minimum effort as I don't think it is worth to add more complexity to the assertion function just for this particular case. Thus I suggest that we report the check differently if it is in an explanatory group, there it is not really necessary to show that information and a different text could be more helpful. This way we can keep the logic in the function the same. Something like the following:
expected that subject: kotlin.sequences.SequencesKt___SequencesKt$asIterable$$inlined$Iterable$1@5453dabb (kotlin.sequences.SequencesKt___SequencesKt$asIterable$$inlined$Iterable$1 <1414781627>)
◆ does not contain:
⚬ an element which:
» no assertion specified
✔ ▶ number of such entries: 0
◾ is: 0 (kotlin.Int <449752083>)
✔ ▶ has at least one element: true
◾ is: true
✘ at least one assertion defined: false
» You forgot to define assertions in the assertionCreator-lambda
» Sometimes you can use an alternative to `{ }` For instance, instead of `toThrow<..> { }` you should use `toThrow<..>()`"
Affected Version: 1.7
API (fluent-en_GB, infix-en_GB): both
Platform (jvm, js): logic
Extension (none, kotlin 1.3): none
produces
and
expect(oneToSeven()).notToContainFun({}, {toBeLessThan(3.0)})
produces
Describe the bug
On IterableLike
notToContain.entry/entries
the empty assertionCreator lambda is getting added twice. InInAnyOrderEntriesAssertionCreator
it appears to be getting added once inaddEmptyAssertionCreatorLambdaIfNeccessary
and once increateExplanatoryAssertionGroup
.I added a test in this branch to take a look at this issue:
https://github.com/wordhou/atrium/blob/empty-assertion-creator-issues/misc/specs/atrium-specs-common/src/main/kotlin/ch/tutteli/atrium/specs/integration/IterableNotToContainEntriesExpectationsSpec.kt#L106
The text was updated successfully, but these errors were encountered: