Skip to content

Commit

Permalink
Merge pull request pmem#1183 from osalyk/fixes
Browse files Browse the repository at this point in the history
tools: fix invalid escape sequence + fix typo
  • Loading branch information
ldorau committed Jul 30, 2021
2 parents 8b30dda + 883a864 commit 0bb3f31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tools/perf/lib/Figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def html_data_table(self):
# rows
for oneseries in self.series:
# since the output is processed as markdown, special characters have to be escaped
html += "<tr><td>" + oneseries['label'].replace('_', '\_') + "</td>"
html += "<tr><td>" + oneseries['label'].replace('_', '\\_') + "</td>"
for point in oneseries['points']:
html += "<td>" + str(point[1]) + "</td>"
html += "</tr>"
Expand Down
6 changes: 3 additions & 3 deletions tools/perf/tests/lib/figure/test_html_data_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Copyright 2021, Intel Corporation
#

"""test_html_data_table.py.py -- lib.Figure.html_data_table() tests"""
"""test_html_data_table.py -- lib.Figure.html_data_table() tests"""

import pytest
from lib.common import json_from_file
Expand All @@ -30,8 +30,8 @@
]
}

HTML = "<table><thead><tr><th></th><th>0</th><th>1</th><th>2</th></tr></thead><tbody><tr><td>label\_1</td><td>3</td><td>4</td><td>5</td></tr><tr><td>label\_2</td><td>6</td><td>7</td><td>8</td></tr></tbody></table>"
HTML = "<table><thead><tr><th></th><th>0</th><th>1</th><th>2</th></tr></thead><tbody><tr><td>label\\_1</td><td>3</td><td>4</td><td>5</td></tr><tr><td>label\\_2</td><td>6</td><td>7</td><td>8</td></tr></tbody></table>"

def test_html_data_table_basic():
""" basic lib.Figure.html_data_table() test """
"""basic lib.Figure.html_data_table() test"""
assert Figure(DATA).html_data_table() == HTML

0 comments on commit 0bb3f31

Please sign in to comment.