@@ -28,7 +28,7 @@ def f(x):
28
28
expected = (
29
29
r"f(x) ="
30
30
r" \left\{ \begin{array}{ll}"
31
- r" 1, & \mathrm{if} \ x = 0 \\"
31
+ r"1, & \mathrm{if} \ x = 0 \\"
32
32
r" 3 x, & \mathrm{otherwise}"
33
33
r" \end{array} \right."
34
34
)
@@ -50,7 +50,7 @@ def test_visit_match() -> None:
50
50
).body [0 ]
51
51
expected = (
52
52
r"\left\{ \begin{array}{ll}"
53
- r" 1, & \mathrm{if} \ x = 0 \\"
53
+ r"1, & \mathrm{if} \ x = 0 \\"
54
54
r" 2, & \mathrm{otherwise}"
55
55
r" \end{array} \right."
56
56
)
@@ -74,7 +74,7 @@ def test_visit_multiple_match_cases() -> None:
74
74
).body [0 ]
75
75
expected = (
76
76
r"\left\{ \begin{array}{ll}"
77
- r" 1, & \mathrm{if} \ x = 0 \\"
77
+ r"1, & \mathrm{if} \ x = 0 \\"
78
78
r" 2, & \mathrm{if} \ x = 1 \\"
79
79
r" 3, & \mathrm{otherwise}"
80
80
r" \end{array} \right."
@@ -192,7 +192,7 @@ def test_visit_match_case_with_if() -> None:
192
192
textwrap .dedent (
193
193
"""
194
194
match x:
195
- case x if x> 0:
195
+ case x if x > 0:
196
196
return 1
197
197
case _:
198
198
return 2
@@ -202,7 +202,7 @@ def test_visit_match_case_with_if() -> None:
202
202
203
203
assert (
204
204
function_codegen .FunctionCodegen ().visit (tree )
205
- == r"\left\{ \begin{array}{ll} "
205
+ == r"\left\{ \begin{array}{ll}"
206
206
+ r"1, & \mathrm{if} \ x > 0 \\ "
207
207
+ r"2, & \mathrm{otherwise} \end{array} \right."
208
208
)
@@ -224,9 +224,9 @@ def test_visit_match_case_with_if_and() -> None:
224
224
225
225
assert (
226
226
function_codegen .FunctionCodegen ().visit (tree )
227
- == r"\left\{ \begin{array}{ll} 1, & \mathrm{if} "
228
- + r"\ x > 0 \land x \le 10 \\ "
229
- + r"2, & \mathrm{otherwise} \end{array} \right."
227
+ == r"\left\{ \begin{array}{ll}1, & \mathrm{if} "
228
+ + r"\ x > 0 \land x \le 10 \\"
229
+ + r" 2, & \mathrm{otherwise} \end{array} \right."
230
230
)
231
231
232
232
@@ -246,9 +246,9 @@ def test_visit_matchcase_with_if_or() -> None:
246
246
247
247
assert (
248
248
function_codegen .FunctionCodegen ().visit (tree )
249
- == r"\left\{ \begin{array}{ll} 1, "
250
- + r"& \mathrm{if} \ x > 0 \lor x \le 10 \\ "
251
- + r"2, & \mathrm{otherwise} \end{array} \right."
249
+ == r"\left\{ \begin{array}{ll}1, "
250
+ + r" & \mathrm{if} \ x > 0 \lor x \le 10 \\"
251
+ + r" 2, & \mathrm{otherwise} \end{array} \right."
252
252
)
253
253
254
254
@@ -268,9 +268,9 @@ def test_visit_match_case_with_combined_condition() -> None:
268
268
269
269
assert (
270
270
function_codegen .FunctionCodegen ().visit (tree )
271
- == r"\left\{ \begin{array}{ll} 1, "
272
- + r"& \mathrm{if} \ 0 < x \le 10 \\ 2, "
273
- + r"& \mathrm{otherwise} \end{array} \right."
271
+ == r"\left\{ \begin{array}{ll}1, "
272
+ + r" & \mathrm{if} \ 0 < x \le 10 \\ 2,"
273
+ + r" & \mathrm{otherwise} \end{array} \right."
274
274
)
275
275
276
276
@@ -290,6 +290,6 @@ def test_visit_match_case_or() -> None:
290
290
291
291
assert (
292
292
function_codegen .FunctionCodegen ().visit (tree )
293
- == r"\left\{ \begin{array}{ll} 1, & \mathrm{if} \ x = 0 \lor x = 1 \\"
293
+ == r"\left\{ \begin{array}{ll}1, & \mathrm{if} \ x = 0 \lor x = 1 \\"
294
294
+ r" 2, & \mathrm{otherwise} \end{array} \right."
295
295
)
0 commit comments