Skip to content

Commit 1b2f230

Browse files
committed
Debug t_mp_logger failures on GitHub.
1 parent 14934ca commit 1b2f230

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

lib/t/t_mp_logger.m

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ function t_mp_logger(quiet)
4141
else
4242
expected = sprintf(' first: ''one''\n second: 2\n pi: 3.1416\n\n 2.7183\n\n');
4343
end
44-
t_str_match(c, expected, [t 'mp_disp - outputs to console']);
44+
if ~t_str_match(c, expected, [t 'mp_disp - outputs to console']);
45+
fprintf('\ngot: "%s"\n', c);
46+
fprintf('exp: "%s"\n', expected);
47+
end
4548

4649
c = evalc('mp_printf(''Hello %s!\n\n'', ''mp_printf''); mp_printf(''This is %d\nlines of\ntext (%s).\n'', 3, ''I think'');');
4750
expected = sprintf('Hello mp_printf!\n\nThis is 3\nlines of\ntext (I think).\n');
@@ -79,7 +82,10 @@ function t_mp_logger(quiet)
7982
end
8083
mp.logger.manager('clear', fname);
8184
t_file_match(fname, redir_disp_fname, [t 'mp_disp - file w/expected content'], {}, true);
82-
t_str_match(c, expected, [t 'mp_disp - outputs to console']);
85+
if ~t_str_match(c, expected, [t 'mp_disp - outputs to console']);
86+
fprintf('\ngot: "%s"\n', c);
87+
fprintf('exp: "%s"\n', expected);
88+
end
8389
t_ok(isempty(mp.logger.manager('get')), [t 'mp.logger.manage(''clear'')']);
8490

8591
fname = sprintf('redir-printf-%d.txt', fix(rand*1e8));

0 commit comments

Comments
 (0)