Replace leftover string with the proper type in C# set typemap

This is just a mistake remaining from generalizing the old
string-specific typemap to any type.

Fix it now and update a unit test to test for sets of objects other than
strings.
This commit is contained in:
Vadim Zeitlin 2019-06-26 01:14:14 +02:00
commit 53d75dc133
4 changed files with 32 additions and 1 deletions

View file

@ -85,5 +85,12 @@ public class runme
ss = new StringSet{"foo", "bar", "baz"};
ss.UnionWith(new[] {"baz", "quux"});
checkThat(ss.SetEquals(new[] {"foo", "bar", "baz", "quux"}), "UnionWith works");
// Check a set of another type.
FooSet fooSet = new FooSet();
ISet<Foo> fooISet = fooSet;
checkThat(fooISet.Count == 0, "is initially empty");
checkThat(fooISet.Add(new Foo(17)), "added successfully");
checkThat(fooISet.Count == 1, "is not empty any more");
}
}