File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,27 @@ public class DynamicListTest
101101 assertNull (list .unsafe_get (list .size ()));
102102 }
103103
104+ @ Test public void sort_validation ()
105+ {
106+ DynamicList <Integer > list = new DynamicList <>();
107+
108+ list .unsafe_add (10 , 3 );
109+ assertEquals (list .size (), 4 );
110+ list .unsafe_add (5 , 1 );
111+ assertEquals (list .size (), 5 );
112+
113+
114+ assertNull (list .unsafe_get (0 ));
115+ assertNull (list .unsafe_get (2 ));
116+
117+ list .sort ();
118+
119+ assertEquals (list .get (0 ), (Integer ) 5 );
120+ assertEquals (list .get (1 ), (Integer ) 10 );
121+ assertNull (list .unsafe_get (3 ));
122+ assertEquals (list .size (), 2 );
123+ }
124+
104125 @ Test public void toString_validation ()
105126 {
106127 DynamicList <Integer > list = new DynamicList <>();
You can’t perform that action at this time.
0 commit comments