eeue56 / elm-html-test

Test elm-html in Elm!
http://package.elm-lang.org/packages/eeue56/elm-html-test/latest
BSD 3-Clause "New" or "Revised" License
67 stars 15 forks source link

Better error message for `Query.count` out of bounds #59

Open rtfeldman opened 6 years ago

rtfeldman commented 6 years ago

Currently:

    ▼ Query.index 1

    0 matches found for this query.

    ✗ Query.index 1 always expects to find 1 element, but it found 0 instead.

Better:

    ▼ Query.index 1

    0 matches found for this query.

    ✗ Query.index 1 returned no matches because it was searching a list of length 1. The highest index that could find an element in this list would be Query.index 0.
eeue56 commented 6 years ago

Proposed better is too wordy I think. How about something alone the lines

Query.index 1 expects a list of two elements, but I got one