SortedSet: Add move view tests.
authorRaja R Harinath <harinath@hurrynot.org>
Fri, 9 Apr 2010 07:00:25 +0000 (07:00 -0000)
committerRaja R Harinath <harinath@hurrynot.org>
Fri, 9 Apr 2010 07:00:25 +0000 (07:00 -0000)
svn path=/trunk/mcs/; revision=155126

mcs/class/System/Test/System.Collections.Generic/SortedSetTest.cs

index bf6b40dcd044b3a4fd5cd08353eb2a8d39dae5f6..b6dcc921dd7bec93885c4ece08c3a3166efe06b0 100644 (file)
@@ -248,6 +248,28 @@ namespace MonoTests.System.Collections.Generic
                        Assert.IsTrue (view.SequenceEqual (new [] { 5 }));
                }
 
+               void EmptySubView (SortedSet<int> set)
+               {
+                       var view = set.GetViewBetween (-20, -15);
+                       Assert.AreEqual (0, view.Count);
+                       Assert.AreEqual (0, view.Min);
+                       Assert.AreEqual (0, view.Max);
+
+                       view = set.GetViewBetween (15, 20);
+                       Assert.AreEqual (0, view.Count);
+                       Assert.AreEqual (0, view.Min);
+                       Assert.AreEqual (0, view.Max);
+               }
+
+               [Test]
+               public void EmptySubView ()
+               {
+                       EmptySubView (new SortedSet<int> ());
+                       EmptySubView (new SortedSet<int> { 1, 3, 5, 7, 9 });
+                       EmptySubView (new SortedSet<int> { -40, 40 });
+                       EmptySubView (new SortedSet<int> { -40, -10, 10, 40 });
+               }
+
                [Test]
                public void ViewMin ()
                {