<commit_before><?php
require_once dirname(__FILE__).'/../phpunit2.php';

class ListItem
{
	public $data='data';
}

/**
 * @package System.Collections
 */
class TListTest extends PHPUnit2_Framework_TestCase {
  protected $list;
  protected $item1,$item2,$item3;

  public function setUp() {
    $this->list=new TList;
    $this->item1=new ListItem;
    $this->item2=new ListItem;
    $this->item3=new ListItem;
    $this->list->add($this->item1);
    $this->list->add($this->item2);
  }

  public function tearDown() {
    $this->list=null;
    $this->item1=null;
    $this->item2=null;
    $this->item3=null;
  }

  public function testConstruct() {
    $a=array(1,2,3);
    $list=new TList($a);
    $this->assertEquals(3,$list->getCount());
    $list2=new TList($this->list);
    $this->assertEquals(2,$list2->getCount());
  }

  public function testGetCount() {
    $this->assertEquals(2,$this->list->getCount());
    $this->assertEquals(2,$this->list->Count);
  }

  public function testAdd() {
    $this->list->add(null);
    $this->list->add($this->item3);
    $this->assertEquals(4,$this->list->getCount());
    $this->assertEquals(3,$this->list->indexOf($this->item3));
  }

  public function testInsert() {
    $this->list->insert(0,$this->item3);
    $this->assertEquals(3,$this->list->getCount());
    $this->assertEquals(2,$this->list->indexOf($this->item2));
    $this->assertEquals(0,$this->list->indexOf($this->item3));
    $this->assertEquals(1,$this->list->indexOf($this->item1));
    try {
      $this->list->insert(4,$this->item3);
      $this->fail('exception not raised when adding item at an out-of-range index');
    } catch(TInvalidDataValueException $e) {

    }
  }

  public function testRemove() {
    $this->list->remove($this->item1);
    $this->assertEquals(1,$this->list->getCount());
    $this->assertEquals(-1,$this->list->indexOf($this->item1));
    $this->assertEquals(0,$this->list->indexOf($this->item2));
    try {
      $this->list->remove($this->item1);<commit_msg>changed test for item() to itemAt()<commit_after><?php
require_once dirname(__FILE__).'/../phpunit2.php';

class ListItem
{
	public $data='data';
}

/**
 * @package System.Collections
 */
class TListTest extends PHPUnit2_Framework_TestCase {
  protected $list;
  protected $item1,$item2,$item3;

  public function setUp() {
    $this->list=new TList;
    $this->item1=new ListItem;
    $this->item2=new ListItem;
    $this->item3=new ListItem;
    $this->list->add($this->item1);
    $this->list->add($this->item2);
  }

  public function tearDown() {
    $this->list=null;
    $this->item1=null;
    $this->item2=null;
    $this->item3=null;
  }

  public function testConstruct() {
    $a=array(1,2,3);
    $list=new TList($a);
    $this->assertEquals(3,$list->getCount());
    $list2=new TList($this->list);
    $this->assertEquals(2,$list2->getCount());
  }

  public function testGetCount() {
    $this->assertEquals(2,$this->list->getCount());
    $this->assertEquals(2,$this->list->Count);
  }

  public function testAdd() {
    $this->list->add(null);
    $this->list->add($this->item3);
    $this->assertEquals(4,$this->list->getCount());
    $this->assertEquals(3,$this->list->indexOf($this->item3));
  }

  public function testInsertAt() {
    $this->list->insertAt(0,$this->item3);
    $this->assertEquals(3,$this->list->getCount());
    $this->assertEquals(2,$this->list->indexOf($this->item2));
    $this->assertEquals(0,$this->list->indexOf($this->item3));
    $this->assertEquals(1,$this->list->indexOf($this->item1));
    try {
      $this->list->insertAt(4,$this->item3);
      $this->fail('exception not raised when adding item at an out-of-range index');
    } catch(TInvalidDataValueException $e) {

    }
  }

  public function testRemove() {
    $this->list->remove($this->item1);
    $this->assertEquals(1,$this->list->getCount());
    $this->assertEquals(-1,$this->list->indexOf($this->item1));
    $this->assertEquals(0,$this->list->indexOf($this->item2));
    try {
      $this->list->remove($this->item1);
{'fraction_non_alphanumeric': 0.2129767211490837, 'fraction_numerical': 0.021792966815255076, 'mean_word_length': 4.0361596009975065, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 155, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4506891', 'n_tokens_mistral': 1382, 'n_tokens_neox': 1365, 'n_words': 184}