%testTime.m  test Time.m
%R.Lee for CISC 106, Section 80, 10/01/2007
  
%Test the formula to calculate the time given acceleration and
% change in velocity

%%%%%%%%%%%%%%%%%%%%%%
%define the tolerance%
%%%%%%%%%%%%%%%%%%%%%%

%tolerance is how far away from the expected value the result is allowed to be

tolerance = .000001;

%%%%%%%%%%%%%%%
%Run the tests%
%%%%%%%%%%%%%%%

%Test 1

actual = time(10,10);
expected = 1;

diff = abs(expected-actual)

if (diff<tolerance)
 disp ('test 1 passed');
else
 disp ('test1failed');
 expected
 actual
end


%Test 2

actual = time(10,50);
expected = 5;

diff = abs(expected-actual)

if (diff<tolerance)
 disp ('test2passed')
else
 disp ('test2failed');
 expected
 actual
 end

%end testTime.m
