File tree Expand file tree Collapse file tree
src/test/java/com/thealgorithms/datastructures/bag Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020 <dependency >
2121 <groupId >org.junit</groupId >
2222 <artifactId >junit-bom</artifactId >
23- <version >6.0.3 </version >
23+ <version >6.1.0 </version >
2424 <type >pom</type >
2525 <scope >import</scope >
2626 </dependency >
Original file line number Diff line number Diff line change @@ -98,11 +98,9 @@ void testIterator() {
9898 @ Test
9999 void testIteratorEmptyBag () {
100100 Bag <String > bag = new Bag <>();
101- int count = 0 ;
102- for (String ignored : bag ) {
103- org .junit .jupiter .api .Assertions .fail ("Iterator should not return any items for an empty bag" );
101+ for (String item : bag ) {
102+ org .junit .jupiter .api .Assertions .fail ("Iterator returned item for an empty bag:" + item );
104103 }
105- assertEquals (0 , count , "Iterator should not traverse any items in an empty bag" );
106104 }
107105
108106 @ Test
You can’t perform that action at this time.
0 commit comments