From f8a442859b671d0d1b58bb6f12446e14a718004e Mon Sep 17 00:00:00 2001 From: Angelika Cathor Date: Wed, 28 Aug 2024 10:41:06 +0200 Subject: [PATCH] Sync custom-set (#1516) --- exercises/practice/custom-set/.meta/tests.toml | 3 +++ exercises/practice/custom-set/test/custom_set_test.exs | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/exercises/practice/custom-set/.meta/tests.toml b/exercises/practice/custom-set/.meta/tests.toml index 8c450e0ba..430c139e6 100644 --- a/exercises/practice/custom-set/.meta/tests.toml +++ b/exercises/practice/custom-set/.meta/tests.toml @@ -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" diff --git a/exercises/practice/custom-set/test/custom_set_test.exs b/exercises/practice/custom-set/test/custom_set_test.exs index add6e0ae6..de59f06c4 100644 --- a/exercises/practice/custom-set/test/custom_set_test.exs +++ b/exercises/practice/custom-set/test/custom_set_test.exs @@ -289,6 +289,15 @@ defmodule CustomSetTest do expected = CustomSet.new([1, 3]) assert CustomSet.equal?(actual, expected) end + + @tag :pending + test "difference removes all duplicates in the first set" do + custom_set_1 = CustomSet.new([1, 1]) + custom_set_2 = CustomSet.new([1]) + actual = CustomSet.difference(custom_set_1, custom_set_2) + expected = CustomSet.new([]) + assert CustomSet.equal?(actual, expected) + end end describe "union" do