function result = performEqualTest(actual,expected,testNum)
%performEqualTest  perform one test to see if actual==expected
%
% consumes: actual--the actual result of the function
%           expected--what we expected the function to return
%           testNum--which test number to report in the message
% produces: result--boolean, true if test passed, false if failed
% prints:   message indicating status of test
%           and value of actual and expected if test fails
%
% Examples: (typically used with ; to supress return value)
%
% This should show tests 1,2,3,and 7 pass, while tests 4 5 and 6 fail.
%
%  performEqualTest(isOdd(2),false,'1');
%  performEqualTest(isOdd(7),true,'2');
%  performEqualTest([3 4 5],[3 4 5],'3');
%  performEqualTest([4 4 4],[4],'4');
%  performEqualTest([2 3 4],[4 5],'5');
%  performEqualTest([],[3 4],'6');
%  performEqualTest([],[],'7');
%
% P. Conrad for CISC106, sect 99, 10/07/2007

% perform a test to see if actual equals expected
% and print appropriate message

  if (isempty(actual) && isempty(expected))

    % //** (5 pts) fill in the missing line of code 
    result = true; % //* if both are empty, then the test passes
  elseif (length(actual) ~= length(expected)) % lengths don't match
    result = false;
  elseif ( actual == expected) % non empty, and they all match
    result = true;
  else
    result = false;
  end; % if

  if (result)
    disp(['test ' testNum ' passed']);
  else
    disp(['test ' testNum ' failed']);
    expected
    actual
  end

  return;
end
