@@ -871,6 +871,70 @@ Describe filetype indent
871871 End
872872 End
873873
874+ Describe match statement
875+ It aligns with left brackets
876+ let in = "match expr:\<CR>"
877+ let in .= "case (spam,\<CR>eggs):"
878+ let out = [
879+ \ 'match expr:',
880+ \ ' case (spam,',
881+ \ ' eggs):',
882+ \]
883+ Assert Equals(Insert(in), Buffer(out))
884+ End
885+
886+ It increases the indent level by 2
887+ let b:python_indent_multiline_statement = 1
888+ let in = "match expr:\<CR>"
889+ let in .= "case (spam,\<CR>eggs):"
890+ let out = [
891+ \ 'match expr:',
892+ \ ' case (spam,',
893+ \ ' eggs):',
894+ \]
895+ Assert Equals(Insert(in), Buffer(out))
896+ End
897+
898+ It increases the indent level (hanging indent)
899+ let in = "match expr:\<CR>"
900+ let in .= "case (\<CR>spam,\<CR>eggs,\<CR>):"
901+ let out = [
902+ \ 'match expr:',
903+ \ ' case (',
904+ \ ' spam,',
905+ \ ' eggs,',
906+ \ ' ):',
907+ \]
908+ Assert Equals(Insert(in), Buffer(out))
909+ End
910+
911+ It increases the indent level by 2 (hanging indent)
912+ let b:python_indent_multiline_statement = 1
913+ let in = "match expr:\<CR>"
914+ let in .= "case (\<CR>spam,\<CR>eggs,\<CR>):"
915+ let out = [
916+ \ 'match expr:',
917+ \ ' case (',
918+ \ ' spam,',
919+ \ ' eggs,',
920+ \ ' ):',
921+ \]
922+ Assert Equals(Insert(in), Buffer(out))
923+ End
924+
925+ It increases the indent level (line continueation)
926+ let in = "match obj \\\<CR>.meth():\<CR>"
927+ let in .= "case spam, \\\<CR>eggs:"
928+ let out = [
929+ \ 'match obj \',
930+ \ ' .meth():',
931+ \ ' case spam, \',
932+ \ ' eggs:',
933+ \]
934+ Assert Equals(Insert(in), Buffer(out))
935+ End
936+ End
937+
874938 Describe function definition
875939 It aligns with left brackets
876940 let in = "def spam(*args,\<CR>**kwargs):"
0 commit comments