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

fix(primitive_types4): Fail on a slice covering the wrong area #209

Merged
merged 1 commit into from
Aug 18, 2019

Conversation

dylnuge
Copy link
Contributor

@dylnuge dylnuge commented Aug 18, 2019

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 printlns 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.

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.
Copy link
Contributor

@komaeda komaeda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congrats on your first Rust contribution! I agree, we should at some point overhaul the way Rustlings checks for correctness. Alas, if only open source would be better at incentivizing unpaid labor...

@komaeda
Copy link
Contributor

komaeda commented Aug 18, 2019

@bors: r+

@bors
Copy link
Contributor

bors commented Aug 18, 2019

📌 Commit 5b1e673 has been approved by komaeda

@bors
Copy link
Contributor

bors commented Aug 18, 2019

⌛ Testing commit 5b1e673 with merge c5bb322...

bors added a commit that referenced this pull request Aug 18, 2019
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.
@bors
Copy link
Contributor

bors commented Aug 18, 2019

☀️ Test successful - checks-travis
Approved by: komaeda
Pushing c5bb322 to master...

@bors bors merged commit 5b1e673 into rust-lang:master Aug 18, 2019
@dylnuge dylnuge deleted the slice-assert branch August 18, 2019 15:46
@dylnuge
Copy link
Contributor Author

dylnuge commented Aug 18, 2019

@komaeda I'm happy to take a pass at moving all the other exercises from compile to test if that seems like the right way to go about it. I wasn't sure if there was another option that might be preferable (e.g. panicking when hitting a failed condition)

ageorgou added a commit to ageorgou/rustlings that referenced this pull request Nov 13, 2019
Exercise was changed to test (and the order was switched) in rust-lang#209.
ageorgou added a commit to ageorgou/rustlings that referenced this pull request Nov 13, 2019
Exercise was changed to test (and the order was switched) in rust-lang#209.
pedantic79 pushed a commit to pedantic79/rustlings that referenced this pull request Apr 11, 2020
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.
pedantic79 pushed a commit to pedantic79/rustlings that referenced this pull request Apr 11, 2020
Exercise was changed to test (and the order was switched) in rust-lang#209.
ppp3 pushed a commit to ppp3/rustlings that referenced this pull request May 23, 2022
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.
ppp3 pushed a commit to ppp3/rustlings that referenced this pull request May 23, 2022
Exercise was changed to test (and the order was switched) in rust-lang#209.
dmoore04 pushed a commit to dmoore04/rustlings that referenced this pull request Sep 11, 2022
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.
dmoore04 pushed a commit to dmoore04/rustlings that referenced this pull request Sep 11, 2022
Exercise was changed to test (and the order was switched) in rust-lang#209.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants