diff --git a/src/IListTest.java b/src/IListTest.java index 8d87919..b2129df 100644 --- a/src/IListTest.java +++ b/src/IListTest.java @@ -1,10 +1,9 @@ - public class IListTest { public static void main(String[] args) { System.out.println("The testing is starting..."); - + IList list = new List(); - + /*************************************** * Testing to add elements to the list. ***************************************/ @@ -12,18 +11,18 @@ list.addAt(1, "2"); // 1, 2 list.addAt(0, "3"); // 3, 1, 2 list.addAt(1, "4"); // 3, 4, 1, 2 - + System.out.println("Expected output: 3, 4, 1, 2"); for (int i = 0; i < list.size(); ++i) { System.out.println(list.getAllElementsAsStrings()[i]); } - + /*************************************** * Testing to get the size of the list. ***************************************/ System.out.println("Expected output: Size: 4"); System.out.println("Size: " + list.size()); - + /*************************************** * Testing to remove two elements and a third element that doesn't exist. ***************************************/ @@ -31,7 +30,7 @@ System.out.println(list.removeAt(0)); // 4, 1, 2 System.out.println(list.removeAt(2)); // 4, 1 System.out.println(list.removeAt(2)); // 4, 1 - + /*************************************** * Print out the list. ***************************************/ @@ -39,14 +38,14 @@ for (int i = 0; i < list.size(); ++i) { System.out.println(list.getAllElementsAsStrings()[i]); } - + /*************************************** * Try to find an item that exists, and one that doesn't. ***************************************/ System.out.println("Expected output: 1, -1"); System.out.println(list.find("1")); System.out.println(list.find("2")); - + /*************************************** * Testing appending a list to a list. ***************************************/ @@ -54,14 +53,14 @@ newList.addAt(5, "5"); newList.addAt(5, "7"); newList.addAt(5, "11"); - + list.append(newList); - + System.out.println("Expected output: 4, 1, 5, 7, 11"); for (int i = 0; i < list.size(); ++i) { System.out.println(list.getAllElementsAsStrings()[i]); } - + /*************************************** * Testing to clear the list and remove an element from an empty list. ***************************************/ @@ -69,7 +68,7 @@ list.clear(); System.out.println("Size: " + list.size()); System.out.println(list.removeAt(0)); - + System.out.println("The testing has ended..."); } }