function success = teststrequal(x, y) %TESTSTREQUAL verbose version of ISEQUAL special-cased to pairs of strings % % success = teststrequal(x, y) % % Verbose version of isequal(x, y) for use in test cases. % x and y should be strings. % Iain Murray, November 2007 if isequal(x, y) fprintf('OK (tested strings equal)\n'); else max_len = 30; if length(x) > max_len x = [x(1:max_len-3),'...']; end if length(y) > max_len y = [y(1:max_len-3),'...']; end fprintf('FAILURE: "%s" != "%s"\n', x, y); end