<commit_before>package cs201.test.transitTests;

import junit.framework.TestCase;
import cs201.agents.transit.CarAgent;
import cs201.structures.Structure;
import cs201.structures.transit.BusStop;
import cs201.test.mock.Brandon.transit.MockPassenger;

public class CarAgentTest extends TestCase
{
	CarAgent car;
	
	MockPassenger pass,pass2;
	
	Structure s1,s2;
	
	public void setUp() throws Exception
	{
		car = new CarAgent();
		car.testing = true;
		
		pass = new MockPassenger("Passenger 1");
		
		s1 = new BusStop(0, 0, 0, 0, 0, null);
		s2 = new BusStop(20, 20, 0, 0, 1, null);
	}
	
	public void testOnePassengerOneCar()
	{
		assertEquals("Passenger should have no logs",0,pass.log.size());
		assertTrue("Car should not have a passenger",car.p == null);
		
		car.msgCallCar(pass, s1, s2);
		
		assertEquals("Car should have a pickup request",1,car.pickups.size());
		assertTrue("Car's destination should still be null",null == car.destination);
		
		assertTrue("Scheduler should be true",car.pickAndExecuteAnAction());

		assertEquals("Car's location should be s1",s1,car.currentLocation);
		assertEquals("Car's destination should be s2",s2,car.destination);
		assertEquals("Car's passenger should be pass",pass,car.p);
		
		assertTrue("Scheduler should be true",car.pickAndExecuteAnAction());
		
		assertEquals("Car's location should be s2",s2,car.currentLocation);
		assertEquals("Car's passenger should be pass",pass,car.p);
		
		assertTrue("Scheduler should be true",car.pickAndExecuteAnAction());
		
		assertEquals("Passenger's log should have two entries",2,pass.log.size());
		assertEquals("Car's location should be s2",s2,car.currentLocation);
		assertEquals("Car's passenger should be null",null,car.p);
	}
}
<commit_msg>Another test for Car<commit_after>package cs201.test.transitTests;

import junit.framework.TestCase;
import cs201.agents.transit.CarAgent;
import cs201.structures.Structure;
import cs201.structures.transit.BusStop;
import cs201.test.mock.Brandon.transit.MockPassenger;

public class CarAgentTest extends TestCase
{
	CarAgent car;
	
	MockPassenger pass,pass2;
	
	Structure s1,s2;
	
	public void setUp() throws Exception
	{
		car = new CarAgent();
		car.testing = true;
		
		pass = new MockPassenger("Passenger 1");
		pass2 = new MockPassenger("Passenger 2");
		
		s1 = new BusStop(0, 0, 0, 0, 0, null);
		s2 = new BusStop(20, 20, 0, 0, 1, null);
	}
	
	public void testOnePassengerOneCar()
	{
		assertEquals("Passenger should have no logs",0,pass.log.size());
		assertTrue("Car should not have a passenger",car.p == null);
		
		car.msgCallCar(pass, s1, s2);
		
		assertEquals("Car should have a pickup request",1,car.pickups.size());
		assertTrue("Car's destination should still be null",null == car.destination);
		
		assertTrue("Scheduler should be true",car.pickAndExecuteAnAction());

		assertEquals("Car's location should be s1",s1,car.currentLocation);
		assertEquals("Car's destination should be s2",s2,car.destination);
		assertEquals("Car's passenger should be pass",pass,car.p);
		
		assertTrue("Scheduler should be true",car.pickAndExecuteAnAction());
		
		assertEquals("Car's location should be s2",s2,car.currentLocation);
		assertEquals("Car's passenger should be pass",pass,car.p);
		
		assertTrue("Scheduler should be true",car.pickAndExecuteAnAction());
		
		assertEquals("Passenger's log should have two entries",2,pass.log.size());
		assertEquals("Car's location should be s2",s2,car.currentLocation);
		assertEquals("Car's passenger should be null",null,car.p);
	}
	
	public void testTwoPassengerOneCarSequential()
	{
		assertEquals("Passenger should have no logs",0,pass.log.size());
		assertTrue("Car should not have a passenger",car.p == null);
		
		car.msgCallCar(pass, s1, s2);
		
		assertEquals("Car should have a pickup request",1,car.pickups.size());
		assertEquals("Car's destination should be null",null, car.destination);
		
		assertTrue("Scheduler should be true",car.pickAndExecuteAnAction());

		assertEquals("Car's location should be s1",s1,car.currentLocation);
		assertEquals("Car's destination should be s2",s2,car.destination);
		assertEquals("Car's passenger should be pass",pass,car.p);
		
		assertTrue("Scheduler should be true",car.pickAndExecuteAnAction());
		
		assertEquals("Car's location should be s2",s2,car.currentLocation);
		assertEquals("Car's passenger should be pass",pass,car.p);
		
		assertTrue("Scheduler should be true",car.pickAndExecuteAnAction());
		
		assertEquals("Passenger's log should have two entries",2,pass.log.size());
		assertEquals("Car's location should be s2",s2,car.currentLocation);
		assertEquals("Car's passenger should be null",null,car.p);
		
		//Second passenger
		assertEquals("Passenger2 should have no logs",0,pass2.log.size());
		assertTrue("Car should not have a passenger",car.p == null);
		
		car.msgCallCar(pass2, s1, s2);
		
		assertEquals("Car should have a pickup request",1,car.pickups.size());
		assertEquals("Car's destination should be s2",s2,car.destination);
		
		assertTrue("Scheduler should be true",car.pickAndExecuteAnAction());

		assertEquals("Car's location should be s1",s1,car.currentLocation);
		assertEquals("Car's destination should be s2",s2,car.destination);
		assertEquals("Car's passenger should be pass2",pass2,car.p);
		
		assertTrue("Scheduler should be true",car.pickAndExecuteAnAction());
		
		assertEquals("Car's location should be s2",s2,car.currentLocation);
		assertEquals("Car's passenger should be pass2",pass2,car.p);
		
		assertTrue("Scheduler should be true",car.pickAndExecuteAnAction());
		
		assertEquals("Passenger's log should have two entries",2,pass.log.size());
		assertEquals("Car's location should be s2",s2,car.currentLocation);
		assertEquals("Car's passenger should be null",null,car.p);
	}
}

{'fraction_non_alphanumeric': 0.13005028611062944, 'fraction_numerical': 0.022368649211028265, 'mean_word_length': 5.488188976377953, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2641918', 'n_tokens_mistral': 1966, 'n_tokens_neox': 1696, 'n_words': 445}