aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/indent/python/match_case.py15
-rw-r--r--tests/indent/python_spec.lua4
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/indent/python/match_case.py b/tests/indent/python/match_case.py
new file mode 100644
index 000000000..88b56af10
--- /dev/null
+++ b/tests/indent/python/match_case.py
@@ -0,0 +1,15 @@
+a = 0
+
+def test_match_case():
+ match a:
+ case 1:
+ return
+
+
+def test_match():
+ match a:
+
+
+def test_case():
+ match a:
+ case b:
diff --git a/tests/indent/python_spec.lua b/tests/indent/python_spec.lua
index 6f4e0fec7..2b52d4597 100644
--- a/tests/indent/python_spec.lua
+++ b/tests/indent/python_spec.lua
@@ -84,6 +84,10 @@ describe("indent Python:", function()
run:new_line("line_after_indent.py", { on_line = 49, text = "x", indent = 0 })
run:new_line("line_after_indent.py", { on_line = 55, text = "x", indent = 4 })
run:new_line("line_after_indent.py", { on_line = 63, text = "x", indent = 4 })
+ run:new_line("match_case.py", { on_line = 4, text = "pass", indent = 8 })
+ run:new_line("match_case.py", { on_line = 5, text = "pass", indent = 12 })
+ run:new_line("match_case.py", { on_line = 10, text = "pass", indent = 8 })
+ run:new_line("match_case.py", { on_line = 15, text = "pass", indent = 12 })
for _, line in ipairs { 2, 5, 8, 11, 16, 21, 24, 27, 34, 39 } do
run:new_line("return_dedent.py", { on_line = line, text = "x", indent = 0 })