File tree Expand file tree Collapse file tree 1 file changed +1
-15
lines changed
src/test/java/com/thealgorithms/datastructures/stacks Expand file tree Collapse file tree 1 file changed +1
-15
lines changed Original file line number Diff line number Diff line change 44import static org .junit .jupiter .api .Assertions .assertFalse ;
55import static org .junit .jupiter .api .Assertions .assertThrows ;
66import static org .junit .jupiter .api .Assertions .assertTrue ;
7+
78import java .io .ByteArrayOutputStream ;
89import java .io .PrintStream ;
9-
1010import org .junit .jupiter .api .BeforeEach ;
1111import org .junit .jupiter .api .Test ;
1212
13-
1413class NodeStackTest {
1514
1615 private NodeStack <Integer > stack ;
@@ -29,7 +28,6 @@ void testPushAndPeek() {
2928 stack .push (4 );
3029 stack .push (5 );
3130 assertEquals (5 , stack .peek (), "Peek should return the last pushed item" );
32-
3331 }
3432
3533 @ Test
@@ -71,16 +69,4 @@ void testPrintEmptyStack() {
7169 stack .print ();
7270 assertEquals ("" , outputStreamCaptor .toString ().trim (), "The output of an empty stack should be an empty string." );
7371 }
74-
75- @ Test
76- void testPrintNonEmptyStack () {
77- stack .push (3 );
78- stack .push (4 );
79- stack .push (5 );
80-
81- stack .print ();
82-
83- assertEquals ("5 \n 4 \n 3" , outputStreamCaptor .toString ().trim (), "The stack output should match the expected values in LIFO order." );
84- }
8572}
86-
You can’t perform that action at this time.
0 commit comments