-
Notifications
You must be signed in to change notification settings - Fork 515
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
CustomSet exercise allows creating new CustomSet
s with duplicated members
#1275
Comments
I think that a deduplication test is a great idea! I'd be very open to a pr
adding one.
β¦On Sat, Jun 5, 2021, 18:06 MachistΓ© N. Quintana ***@***.***> wrote:
ππ½ I came across an edge case that (I think) currently isn't being
caught by the test cases for CustomSet
<https://exercism.io/tracks/rust/exercises/custom-set> β it's possible to
write a CustomSet::new constructor that internally stores set members
with duplicates, e.g.:
#[derive(Clone, Debug)]
pub struct CustomSet<T> {
members: Vec<T>,
}
impl<T: Clone + PartialEq> CustomSet<T> {
pub fn new(input: &[T]) -> Self {
let members = input.to_vec();
Self { members }
}
}
On the one hand, I don't think the internal representation matters that
much as long as the CustomSets methods account for duplicates.
But, after a cursory glance at the test cases
<https://github.com/exercism/rust/blob/main/exercises/practice/custom-set/tests/custom-set.rs>,
it looks like there aren't any test cases that instantiate a CustomSet
from a slice with duplicate elements, which if I'm reading them right means
a big chunk of a Set's functionality is currently untested (and the test
suite passes solutions that don't actually dedupe members).
Would y'all be open to a PR that adds test cases that test for CustomSet's
deduping ability by passing in slices with duplicate elements?
β
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1275>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3V4TQTAJADFWZK3YBXGZLTRJDSDANCNFSM46EW7FYA>
.
|
senekor
added a commit
to exercism/problem-specifications
that referenced
this issue
Sep 16, 2023
motivated by: exercism/rust#1275
senekor
added a commit
to exercism/problem-specifications
that referenced
this issue
Sep 16, 2023
motivated by: exercism/rust#1275
senekor
added a commit
to exercism/problem-specifications
that referenced
this issue
Sep 16, 2023
motivated by: exercism/rust#1275
should be fixed by exercism/problem-specifications#2324 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ππ½ I came across an edge case that (I think) currently isn't being caught by the test cases for CustomSet β it's possible to write a
CustomSet::new
constructor that internally stores set members with duplicates, e.g.:On the one hand, I don't think the internal representation matters that much as long as the
CustomSet
s methods account for duplicates.But, after a cursory glance at the test cases, it looks like there aren't any test cases that instantiate a
CustomSet
from a slice with duplicate elements, which if I'm reading them right means a big chunk of a Set's functionality is currently untested (and the test suite passes solutions that don't actually dedupe members).Example test case:
Would y'all be open to a PR that adds test cases that test for
CustomSet
's deduping ability by passing in slices with duplicate elements?The text was updated successfully, but these errors were encountered: