Skip to content

Commit

Permalink
custom-set: sync (exercism#1923)
Browse files Browse the repository at this point in the history
  • Loading branch information
senekor authored May 12, 2024
1 parent ccf72a3 commit 3cefffd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
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

0 comments on commit 3cefffd

Please sign in to comment.