-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
rustlings verify accepts option1.rs prematurely #160
Comments
I totally agree that there needs to be a better way of going through these sorts of exercises. It feels like a lot of the exercises are meant for exploring how the language works, and it even appears that the intention is for them to be run multiple times. As an example
It seems like it might be quite difficult to get verify working in a way that runs commands for the user without becoming really messy like you mentioned, but I could imagine the It might make sense at that point to point people towards the I'd happily put something like that together if it sounded like a reasonable solution. Other people have been confused by the way the exercises are used as well (#127). |
I hadn't tried So yeah, maybe the only problem here is that the homepage recommends There were indeed a few other tests that print interesting things (I think |
I'm definitely up for rethinking the user experience flow behind |
I'm not sure I followed the above comments (I'm using
In any case, thanks to komaeda and contributors for this! It's a great little set of exercises. |
Fixes the bug referenced in rust-lang#160, but does not address the larger feature work referenced by the issue.
I also ran into this issue using |
fix(option1): Add test for prematurely passing exercise Fixes the bug referenced in #160, but does not address the larger feature work referenced by the issue.
fix(primitive_types4): Fail on a slice covering the wrong area I noticed this issue and it seems like a similar one was raised/fixed in #160 this way. This is my first contribution to this repo (or any Rust project) so let me know if I messed up or need to fix anything! --- This commit converts primitive_types4 to a test and asserts that the slice given is equal to the expected slice. The intent of the primitive_types4 exercise appears to be to ensure the user understands inclusive and exclusive bounds as well as slice syntax. `rustlings` commands using `compile` do not verify that a specific println is reached and, in the case of `watch` and `verify` (but not `run`), they do not output the `println`s at all. This fix is semantically similar to #198. It does not take a stance on the correct way to handle this for all exercises; see #127. There are likely other exercises whose intent are masked by this issue.
I'm going through these exercises, and this confuses me. assert! takes only one argument right? Or one argument and a message, but should it be |
Hey @Zazcallabah, The point of the exercise is to guide the user to implement error handling for receiving a I think your last suggestion of With that change, would the goal of the exercise be clearer to you? Were you still seeing the exercise pass prematurely? If you think other changes might be necessary and you're not seeing the test pass prematurely, I'm wondering if it would be best to open a new issue or PR a change you think would clarify the exercise. |
The exercise never passed prematurely - it worked fine. It was just when I read that specific assert I got confused if there was something I didn't understand or if there was an accidental extra parameter in the assert. Thank you for clarifying. :D |
No problem, @Zazcallabah, and good call on cleaning up the @marienz (or a project maintainer?), do you think it makes sense to update the title of this issue, since the specific bug of the test passing prematurely has been addressed? I think the conversation about altering |
Gonna close this, feel free to open a separate issue if you want to continue talking about altering |
Fixes the bug referenced in rust-lang#160, but does not address the larger feature work referenced by the issue.
…aeda fix(option1): Add test for prematurely passing exercise Fixes the bug referenced in rust-lang#160, but does not address the larger feature work referenced by the issue.
fix(primitive_types4): Fail on a slice covering the wrong area I noticed this issue and it seems like a similar one was raised/fixed in rust-lang#160 this way. This is my first contribution to this repo (or any Rust project) so let me know if I messed up or need to fix anything! --- This commit converts primitive_types4 to a test and asserts that the slice given is equal to the expected slice. The intent of the primitive_types4 exercise appears to be to ensure the user understands inclusive and exclusive bounds as well as slice syntax. `rustlings` commands using `compile` do not verify that a specific println is reached and, in the case of `watch` and `verify` (but not `run`), they do not output the `println`s at all. This fix is semantically similar to rust-lang#198. It does not take a stance on the correct way to handle this for all exercises; see rust-lang#127. There are likely other exercises whose intent are masked by this issue.
Fixes the bug referenced in rust-lang#160, but does not address the larger feature work referenced by the issue.
…aeda fix(option1): Add test for prematurely passing exercise Fixes the bug referenced in rust-lang#160, but does not address the larger feature work referenced by the issue.
fix(primitive_types4): Fail on a slice covering the wrong area I noticed this issue and it seems like a similar one was raised/fixed in rust-lang#160 this way. This is my first contribution to this repo (or any Rust project) so let me know if I messed up or need to fix anything! --- This commit converts primitive_types4 to a test and asserts that the slice given is equal to the expected slice. The intent of the primitive_types4 exercise appears to be to ensure the user understands inclusive and exclusive bounds as well as slice syntax. `rustlings` commands using `compile` do not verify that a specific println is reached and, in the case of `watch` and `verify` (but not `run`), they do not output the `println`s at all. This fix is semantically similar to rust-lang#198. It does not take a stance on the correct way to handle this for all exercises; see rust-lang#127. There are likely other exercises whose intent are masked by this issue.
Fixes the bug referenced in rust-lang#160, but does not address the larger feature work referenced by the issue.
…aeda fix(option1): Add test for prematurely passing exercise Fixes the bug referenced in rust-lang#160, but does not address the larger feature work referenced by the issue.
fix(primitive_types4): Fail on a slice covering the wrong area I noticed this issue and it seems like a similar one was raised/fixed in rust-lang#160 this way. This is my first contribution to this repo (or any Rust project) so let me know if I messed up or need to fix anything! --- This commit converts primitive_types4 to a test and asserts that the slice given is equal to the expected slice. The intent of the primitive_types4 exercise appears to be to ensure the user understands inclusive and exclusive bounds as well as slice syntax. `rustlings` commands using `compile` do not verify that a specific println is reached and, in the case of `watch` and `verify` (but not `run`), they do not output the `println`s at all. This fix is semantically similar to rust-lang#198. It does not take a stance on the correct way to handle this for all exercises; see rust-lang#127. There are likely other exercises whose intent are masked by this issue.
For
rustlings verify
, mode "compile" really only means "compile": it does not run the resulting program. This means option1.rs (which has a main() that panics) passes before I've completed the exercise. I almost missed the entire exercise, as I was working through them based on the errors fromrustlings verify
.If this behavior from
rustlings verify
is intentional,option1.rs
needs to be changed to a "test" exercise (with either main() itself as test function or a trivial test function that calls main()).Alternatively,
rustlings verify
could start running the code too. Changing it to usecompile_and_run
works but makes the output a little noisy (did confirm I didn't miss any other tests before option1.rs), so it might need a new or refactored function that only prints the output on failure.Alternatively alternatively, rustlings could grow an "exec" mode for exercises like this one.
The text was updated successfully, but these errors were encountered: