aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/progmodes/python-tests.el
diff options
context:
space:
mode:
authorDmitry Gutov2023-03-09 17:24:54 +0200
committerDmitry Gutov2023-03-09 17:31:21 +0200
commit29228e24f20954b93dccef4ac5d704ca31daa80c (patch)
treee691567c2a92435c4313774c5478a86bf5eeae2e /test/lisp/progmodes/python-tests.el
parent01b65d442ad681e6fef0db76451e668125a17038 (diff)
downloademacs-29228e24f20954b93dccef4ac5d704ca31daa80c.tar.gz
emacs-29228e24f20954b93dccef4ac5d704ca31daa80c.zip
python-info-dedenter-opening-block-positions: Fix to support "bare" match
* lisp/progmodes/python.el (python-info-dedenter-opening-block-positions): Make the check stricter. Require that block starts only at indentation. * test/lisp/progmodes/python-tests.el (python-indent-after-bare-match): Another test (bug#62031).
Diffstat (limited to 'test/lisp/progmodes/python-tests.el')
-rw-r--r--test/lisp/progmodes/python-tests.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index 7e2f66e9095..2568299bb66 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -1994,6 +1994,20 @@ def test_re(string):
1994 (python-tests-look-at "else:") 1994 (python-tests-look-at "else:")
1995 (should (= (python-indent-calculate-indentation) 4)))) 1995 (should (= (python-indent-calculate-indentation) 4))))
1996 1996
1997(ert-deftest python-indent-after-bare-match ()
1998 "Test BUG 62031 regression."
1999 (python-tests-with-temp-buffer
2000 "
2001from re import match
2002
2003def test_re(string):
2004 if match('^[a-c]+$', string):
2005 print('yes')
2006 else:
2007 "
2008 (python-tests-look-at "else:")
2009 (should (= (python-indent-calculate-indentation) 4))))
2010
1997 2011
1998;;; Filling 2012;;; Filling
1999 2013