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

forAll displays all errors at once, even when they are too many #929

Closed
Jiehong opened this issue Jul 30, 2019 · 1 comment
Closed

forAll displays all errors at once, even when they are too many #929

Jiehong opened this issue Jul 30, 2019 · 1 comment
Labels
assertions 🔍 Related to the assertion mechanisms within the testing framework. enhancement ✨ Suggestions for adding new features or improving existing ones. good-first-issue 👶 Suitable for newcomers looking to contribute to the project.

Comments

@Jiehong
Copy link
Contributor

Jiehong commented Jul 30, 2019

Hello,

Today, using forAll can be a bit annoying, as it displays all failing cases at once.

Example

forAll(Gen.string().take(1000)) {
    it shouldBe "lovely"
}

You'll get the following output:

java.lang.AssertionError: 0 elements passed but expected 1000

The following elements passed:
--none--

The following elements failed:
<empty string> => expected: "lovely" but was: ""
(900 more lines)

When this happens, the output should only provide a few failing examples, and not all the 1000 examples (would be worse if more were requested).

It's sort of like "shrinking" the possible values for which it doesn't work, and it would make it a bit more user-friendly.

@LeoColman LeoColman added enhancement ✨ Suggestions for adding new features or improving existing ones. good-first-issue 👶 Suitable for newcomers looking to contribute to the project. labels Jul 31, 2019
@sksamuel sksamuel added the assertions 🔍 Related to the assertion mechanisms within the testing framework. label Sep 2, 2019
@sksamuel sksamuel mentioned this issue Nov 25, 2019
88 tasks
@sksamuel
Copy link
Member

Fixed in master.

-Dkotlintest.assertions.output.max=20 now supported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assertions 🔍 Related to the assertion mechanisms within the testing framework. enhancement ✨ Suggestions for adding new features or improving existing ones. good-first-issue 👶 Suitable for newcomers looking to contribute to the project.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants