package ciir.jfoley.chai.collections.list;

import org.junit.Test;

import java.util.Arrays;
import java.util.List;

import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;

public class IntListTest {

	@Test
	public void testAdd() throws Exception {
		IntList test = new IntList(2);
		test.add(1);
		test.add(2);
		test.add(3);
		test.add(4);
		test.add(5);

		assertEquals(Arrays.asList(1,2,3,4,5), test);
    assertArrayEquals(new int[]{1, 2, 3, 4, 5}, test.asArray());
		assertEquals(8, test.size);
	}

	@Test
	public void testAdd2() throws Exception {
		IntList test = new IntList();
		test.add(1);
		test.add(2);
		test.add(3);
		test.add(4);
		test.add(5);

		assertEquals(Arrays.asList(1, 2, 3, 4, 5), test);
		int[] expected = new int[]{1, 2, 3, 4, 5};
		assertArrayEquals(expected, test.asArray());
		assertArrayEquals(expected, test.unsafeArray());
		assertEquals(1, test.getQuick(0));
		assertEquals(8, test.size);
	}

	@Test
	public void testAddAll() {
		List<Integer> original = Arrays.asList(1,2,3,4,5);
		IntList test = new IntList(original);
		assertEquals(original, test);
		assertEquals(8, test.size);
	}

}
@@ -841,24 +841,57 @@
 ray());%0A
+%09%09for (int i = 0; i %3C 5; i++) %7B%0A%09
 %09%09assert
 ArrayEqu
@@ -874,37 +874,32 @@
 i++) %7B%0A%09%09%09assert
-Array
 Equals(expected,
@@ -893,24 +893,27 @@
 als(expected
+%5Bi%5D
 , test.unsaf
@@ -916,26 +916,33 @@
 nsafeArray()
-);
+%5Bi%5D);%0A%09%09%7D
 %0A%09%09assertEqu
@@ -974,33 +974,33 @@
 %0A%09%09assertEquals(
-8
+5
 , test.size);%0A%09%7D
@@ -986,32 +986,34 @@
 als(5, test.size
+()
 );%0A%09%7D%0A%0A%09@Test%0A%09p
@@ -1167,38 +1167,8 @@
 t);%0A
-%09%09assertEquals(8, test.size);%0A
 %09%7D%0A%0A

Fix tests