Skip to content

Commit 6a927a0

Browse files
committed
Fix issue with backslash not being escaped, for tests
1 parent 084b86a commit 6a927a0

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tests/test_simulation.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,12 @@ def check_rendered_trace(self, expected, **kwargs):
148148
extra_line=False, **kwargs)
149149
self.assertEqual(buff.getvalue(), expected)
150150

151-
# TODO replace 'x' with something else (a little confusing since hex repr also uses it)
152151
def test_hex_trace(self):
153152
expected = (
154153
" -0 \n"
155154
"a 0x1 x0x4 x0x9 x0xb x0xc \n"
156155
"b 0x2 x0x17x0x2bx0x78x0x0 \n"
157-
"c _____/---------\____/----\n"
156+
"c _____/---------\\____/----\n" # escaped backslash
158157
)
159158
self.check_rendered_trace(expected)
160159

@@ -163,7 +162,7 @@ def test_oct_trace(self):
163162
" -0 \n"
164163
"a 0o1 x0o4 x0o11 x0o13 x0o14 \n"
165164
"b 0o2 x0o27 x0o53 x0o170x0o0 \n"
166-
"c ______/-----------\_____/-----\n"
165+
"c ______/-----------\\_____/-----\n" # escaped backslash
167166
)
168167
self.check_rendered_trace(expected, repr_func=oct, symbol_len=None)
169168

@@ -172,7 +171,7 @@ def test_bin_trace(self):
172171
" -0 \n"
173172
"a 0b1 x0b100 x0b1001 x0b1011 x0b1100 \n"
174173
"b 0b10 x0b10111 x0b101011 x0b1111000x0b0 \n"
175-
"c __________/-------------------\_________/---------\n"
174+
"c __________/-------------------\\_________/---------\n" # escaped backslash
176175
)
177176
self.check_rendered_trace(expected, repr_func=bin, symbol_len=None)
178177

@@ -181,7 +180,7 @@ def test_decimal_trace(self):
181180
" -0 \n"
182181
"a 1 x4 x9 x11 x12 \n"
183182
"b 2 x23 x43 x120x0 \n"
184-
"c ____/-------\___/---\n"
183+
"c ____/-------\\___/---\n" # escaped backslash
185184
)
186185
self.check_rendered_trace(expected, repr_func=str, symbol_len=None)
187186

0 commit comments

Comments
 (0)