| OLD | NEW |
| (Empty) | |
| 1 /* |
| 2 * Copyright (c) 2012, the Dart project authors. |
| 3 * |
| 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except |
| 5 * in compliance with the License. You may obtain a copy of the License at |
| 6 * |
| 7 * http://www.eclipse.org/legal/epl-v10.html |
| 8 * |
| 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License |
| 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express |
| 11 * or implied. See the License for the specific language governing permissions a
nd limitations under |
| 12 * the License. |
| 13 */ |
| 14 package com.google.dart.engine.utilities.collection; |
| 15 |
| 16 import junit.framework.TestCase; |
| 17 |
| 18 public class IntListTest extends TestCase { |
| 19 public void test_IntList() { |
| 20 IntList firstList = new IntList(); |
| 21 assertNotNull(firstList); |
| 22 assertEquals(0, firstList.size()); |
| 23 |
| 24 IntList secondList = new IntList(20); |
| 25 assertNotNull(secondList); |
| 26 assertEquals(0, secondList.size()); |
| 27 } |
| 28 |
| 29 public void test_IntList_add_grow() { |
| 30 IntList list = new IntList(2); |
| 31 list.add(1); |
| 32 list.add(2); |
| 33 list.add(3); |
| 34 assertEquals(3, list.size()); |
| 35 } |
| 36 |
| 37 public void test_IntList_add_noGrow() { |
| 38 IntList list = new IntList(20); |
| 39 list.add(1); |
| 40 assertEquals(1, list.size()); |
| 41 } |
| 42 |
| 43 public void test_IntList_toArray_empty() { |
| 44 IntList list = new IntList(20); |
| 45 int[] result = list.toArray(); |
| 46 assertNotNull(result); |
| 47 assertEquals(0, result.length); |
| 48 } |
| 49 |
| 50 public void test_IntList_toArray_nonEmpty() { |
| 51 IntList list = new IntList(20); |
| 52 list.add(1); |
| 53 list.add(2); |
| 54 list.add(3); |
| 55 int[] result = list.toArray(); |
| 56 assertNotNull(result); |
| 57 assertEquals(3, result.length); |
| 58 } |
| 59 } |
| OLD | NEW |