From 0c1c5c9fdd1ebe6d47b142e46baa1b76fa584e3c Mon Sep 17 00:00:00 2001 From: Josh Asplund Date: Wed, 23 May 2018 20:01:46 -0500 Subject: [PATCH] Fixes newline mismatches in text tests --- mythril/analysis/templates/report_as_markdown.jinja2 | 7 ++++--- mythril/analysis/templates/report_as_text.jinja2 | 8 ++++---- tests/report_test.py | 8 ++++---- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/mythril/analysis/templates/report_as_markdown.jinja2 b/mythril/analysis/templates/report_as_markdown.jinja2 index 3b09cbe0..2d86c574 100644 --- a/mythril/analysis/templates/report_as_markdown.jinja2 +++ b/mythril/analysis/templates/report_as_markdown.jinja2 @@ -23,14 +23,15 @@ In file: {{ issue.filename }}:{{ issue.lineno }} ``` {{ issue.code }} ``` -{%- endif -%} +{%- endif %} {%- if verbose and issue.debug -%} -------------------- ### Debugging Information: {{ issue.debug }} -{%- endif -%} -{%- endfor -%} +{%- endif %} + +{% endfor -%} {%- else -%} The analysis was completed successfully. No issues were detected. {%- endif -%} diff --git a/mythril/analysis/templates/report_as_text.jinja2 b/mythril/analysis/templates/report_as_text.jinja2 index be21ab6b..8e7856aa 100644 --- a/mythril/analysis/templates/report_as_text.jinja2 +++ b/mythril/analysis/templates/report_as_text.jinja2 @@ -10,17 +10,17 @@ PC address: {{ issue.address }} {% if issue.filename and issue.lineno -%} In file: {{ issue.filename }}:{{ issue.lineno }} {%- endif %} -{% if issue.code -%} --------------------- +{% if issue.code %} {{ issue.code }} -{%- endif -%} + +-------------------- +{% endif -%} {% if verbose and issue.debug -%} -------------------- DEBUGGING INFORMATION: {{ issue.debug }} {%- endif %} - {% endfor -%} {%- else -%} The analysis was completed successfully. No issues were detected. diff --git a/tests/report_test.py b/tests/report_test.py index 3ecb154c..dae6cc4e 100644 --- a/tests/report_test.py +++ b/tests/report_test.py @@ -74,12 +74,12 @@ def _get_changed_files(postfix, report_builder, reports): yield input_file -# def test_json_report(reports): -# _assert_empty(_get_changed_files('.json', lambda report: _fix_path(_fix_debug_data(report.as_json())).strip(), reports), '.json') +def test_json_report(reports): + _assert_empty(_get_changed_files('.json', lambda report: _fix_path(_fix_debug_data(report.as_json())).strip(), reports), '.json') -# def test_markdown_report(reports): -# _assert_empty(_get_changed_files('.markdown', lambda report: _fix_path(report.as_markdown()), reports), '.markdown') +def test_markdown_report(reports): + _assert_empty(_get_changed_files('.markdown', lambda report: _fix_path(report.as_markdown()), reports), '.markdown') def test_text_report(reports):