Skip to content
Snippets Groups Projects
Commit ca9d589c authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

Clarify the message when we truncate the number of lines to standard error.

parent e1c29fcb
No related branches found
No related tags found
No related merge requests found
......@@ -101,7 +101,8 @@ class Command(metaclass=abc.ABCMeta):
buf += line.decode('utf-8', errors='replace')
if len(lines) > Command.MAX_STDERR_LINES:
buf += '[ {} lines ignored ]\n'.format(
buf += '[ truncated after {} lines; {} ignored ]\n'.format(
Command.MAX_STDERR_LINES,
len(lines) - Command.MAX_STDERR_LINES
)
......
......@@ -3,7 +3,7 @@
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2015 Jérémy Bobbio <lunar@debian.org>
# Copyright © 2015-2019 Chris Lamb <lamby@debian.org>
# Copyright © 2015-2020 Chris Lamb <lamby@debian.org>
#
# diffoscope is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -131,4 +131,9 @@ def test_trim_stderr_in_command():
return r
difference = Difference.from_command(FillStderr, 'dummy1', 'dummy2')
assert '[ 1 lines ignored ]' in difference.comment
assert (
'[ truncated after {} lines; 1 ignored ]'.format(
Command.MAX_STDERR_LINES
)
in difference.comment
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment