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

Highlighting Expect.equal diff for large data-structures results in hang #280

Closed
stephenreddek opened this issue Sep 7, 2018 · 2 comments
Labels

Comments

@stephenreddek
Copy link

Running elm-test with the console reporter with a failing test that uses Expect.equal on two large data-structure hangs.

I tested with this quickly (filled the list to be about 400 elements each):

module SSCCE exposing (suite)

import Expect
import Test exposing (..)


testLarge : Test
testLarge =
    test "foo bar" <|
        \() ->
            Expect.equal
                [ { foo = "foo", bar = "baz" }
                , { foo = "foo", bar = "bar" }
                ⋮ 
                ]
                [ { foo = "foo", bar = "bar" }
                , { foo = "foo", bar = "bar" }
                ⋮ 
                ]

It appears to me that the issue is with the Diff just taking too long to run. If you use the junit or json reporter, the tests run quickly.

One solution would be to check the length of the string prior to running the diff in the formatter - similar to how it doesn't diff floats or empty strings.

@rtfeldman rtfeldman added the bug label Sep 17, 2018
@rtfeldman
Copy link
Owner

#319 may have fixed this.

@stephenreddek
Copy link
Author

I apologize for my long delay in responding. This now resolved (tested on0.19.0-rev4). Thank you!

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

No branches or pull requests

2 participants