Fix dev check rejecting exercises with CRLF line endings - #2425
Conversation
|
Close #2424 |
|
Can we just omit the line ending? i.e. just check for |
@senekor Thanks for the review! I'd lean toward keeping the The trailing newline was actually added deliberately in e74f2a4 — the check originally was a bare contains("#[test]"), and I suppose the With a bare Maybe "More means better". |
senekor
left a comment
There was a problem hiding this comment.
I see, makes sense. Thanks for digging. Looks good to me.
Problem
On Windows (or whenever an editor saves an exercise with CRLF line endings),
rustlings dev checkfails with:even though the exercise clearly contains
#[test]functions.Solution
Normalize CRLF to LF when checking whether an exercise contains tests, and add some unit tests.