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

custom-set: sync #1923

Merged
merged 1 commit into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions exercises/practice/custom-set/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ description = "Difference (or Complement) of a set is a set of all elements that
[c5ac673e-d707-4db5-8d69-7082c3a5437e]
description = "Difference (or Complement) of a set is a set of all elements that are only in the first set -> difference of two non-empty sets is a set of elements that are only in the first set"

[20d0a38f-7bb7-4c4a-ac15-90c7392ecf2b]
description = "Difference (or Complement) of a set is a set of all elements that are only in the first set -> difference removes all duplicates in the first set"

[c45aed16-5494-455a-9033-5d4c93589dc6]
description = "Union returns a set of all elements in either set -> union of empty sets is an empty set"

Expand Down
9 changes: 9 additions & 0 deletions exercises/practice/custom-set/tests/custom-set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,15 @@ fn difference_of_two_non_empty_sets_is_a_set_of_elements_that_are_only_in_the_fi
assert_eq!(set_1.difference(&set_2), expected);
}

#[test]
#[ignore]
fn difference_removes_all_duplicates_in_the_first_set() {
let set_1 = CustomSet::<i32>::new(&[1, 1]);
let set_2 = CustomSet::<i32>::new(&[1]);
let expected = CustomSet::<i32>::new(&[]);
assert_eq!(set_1.difference(&set_2), expected);
}

#[test]
#[ignore]
fn union_of_empty_sets_is_an_empty_set() {
Expand Down