Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ internal override T MinInternal
{
get
{
VersionCheck();
Node? current = root;
T? result = default;

Expand Down Expand Up @@ -155,6 +156,7 @@ internal override T MaxInternal
{
get
{
VersionCheck();
Node? current = root;
T? result = default;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,23 @@ public void SortedSet_Generic_GetViewBetween_MinMax_Exhaustive()
}
}
}

[Fact]
public void SortedSet_Generic_GetViewBetween_MinMax_Updating()
{
var set = (SortedSet<int>)CreateSortedSet(new[] { 1 }, 1, 1);
var lowerView = set.GetViewBetween(-5, -2);
var upperView = set.GetViewBetween(2, 5);

set.Add(-3);
set.Add(2);
set.Add(3);

Assert.Equal(-3, lowerView.Min);
Assert.Equal(-3, lowerView.Max);
Assert.Equal(2, upperView.Min);
Assert.Equal(3, upperView.Max);
}
}

public class SortedSet_Generic_Tests_int_With_NullComparer : SortedSet_Generic_Tests_int
Expand Down