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:
parent
2db6b42715
commit
53d75dc133
4 changed files with 32 additions and 1 deletions
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue