diff options
| author | Stefan Monnier | 2023-03-27 17:16:58 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2023-03-27 17:16:58 -0400 |
| commit | 616b22b5b95ce442ee343a18bfbf9ef18d8bb04f (patch) | |
| tree | 5fd048b91fc3b4f65e47c6a838306af01942abdd /test/lisp/progmodes/python-tests.el | |
| parent | cd62dc0dd2d371f45e6e0b4f031b7deb674edf39 (diff) | |
| parent | 8f42db010d15efa21fb9007e61daedbe1e2dfa53 (diff) | |
| download | emacs-616b22b5b95ce442ee343a18bfbf9ef18d8bb04f.tar.gz emacs-616b22b5b95ce442ee343a18bfbf9ef18d8bb04f.zip | |
Merge from origin/emacs-29
8f42db010d1 Improve indenting "case" in Python
c4d490490dc ; * test/src/fns-tests.el: Fix last change
875e77a66a6 * test/infra/Dockerfile.emba (emacs-native-comp): Add zli...
64a2b0d36fe Fix failure of fns-tests-collate-strings on Cygwin
90fc6b987ad * lisp/savehist.el (savehist-save): Preserve shared struc...
08fbc133756 Adapt Tramp manual
accb3871668 Fix system time sampling on MS-Windows
33d436eefa1 Fix treesit_ensure_parsed (bug#62333)
d93a439846f * lisp/help-fns.el (find-lisp-object-file-name): Fix bug#...
be8147c53f9 Improve "Bugs" in the Emacs manual
Diffstat (limited to 'test/lisp/progmodes/python-tests.el')
| -rw-r--r-- | test/lisp/progmodes/python-tests.el | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index ed4a08da6ab..50153e66da5 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el | |||
| @@ -5940,6 +5940,26 @@ def func(): | |||
| 5940 | (equal (list (python-tests-look-at "if (" -1 t)) | 5940 | (equal (list (python-tests-look-at "if (" -1 t)) |
| 5941 | (python-info-dedenter-opening-block-positions))))) | 5941 | (python-info-dedenter-opening-block-positions))))) |
| 5942 | 5942 | ||
| 5943 | (ert-deftest python-info-dedenter-opening-block-positions-7 () | ||
| 5944 | "Test case blocks." | ||
| 5945 | (python-tests-with-temp-buffer | ||
| 5946 | " | ||
| 5947 | match a: | ||
| 5948 | case 1: | ||
| 5949 | match b: | ||
| 5950 | case 2: | ||
| 5951 | something() | ||
| 5952 | case 3: | ||
| 5953 | " | ||
| 5954 | (python-tests-look-at "case 1:") | ||
| 5955 | (should-not (python-info-dedenter-opening-block-positions)) | ||
| 5956 | (python-tests-look-at "case 2:") | ||
| 5957 | (should-not (python-info-dedenter-opening-block-positions)) | ||
| 5958 | (python-tests-look-at "case 3:") | ||
| 5959 | (equal (list (python-tests-look-at "case 2:" -1) | ||
| 5960 | (python-tests-look-at "case 1:" -1 t)) | ||
| 5961 | (python-info-dedenter-opening-block-positions)))) | ||
| 5962 | |||
| 5943 | (ert-deftest python-info-dedenter-opening-block-message-1 () | 5963 | (ert-deftest python-info-dedenter-opening-block-message-1 () |
| 5944 | "Test dedenters inside strings are ignored." | 5964 | "Test dedenters inside strings are ignored." |
| 5945 | (python-tests-with-temp-buffer | 5965 | (python-tests-with-temp-buffer |
| @@ -6125,6 +6145,24 @@ elif b: | |||
| 6125 | (point)) | 6145 | (point)) |
| 6126 | (python-info-dedenter-statement-p))))) | 6146 | (python-info-dedenter-statement-p))))) |
| 6127 | 6147 | ||
| 6148 | (ert-deftest python-info-dedenter-statement-p-6 () | ||
| 6149 | "Test case keyword." | ||
| 6150 | (python-tests-with-temp-buffer | ||
| 6151 | " | ||
| 6152 | match a: # Comment | ||
| 6153 | case 1: | ||
| 6154 | match b: | ||
| 6155 | case 2: | ||
| 6156 | something() | ||
| 6157 | case 3: | ||
| 6158 | " | ||
| 6159 | (python-tests-look-at "case 1:") | ||
| 6160 | (should-not (python-info-dedenter-statement-p)) | ||
| 6161 | (python-tests-look-at "case 2:") | ||
| 6162 | (should-not (python-info-dedenter-statement-p)) | ||
| 6163 | (python-tests-look-at "case 3:") | ||
| 6164 | (should (= (point) (python-info-dedenter-statement-p))))) | ||
| 6165 | |||
| 6128 | (ert-deftest python-info-line-ends-backslash-p-1 () | 6166 | (ert-deftest python-info-line-ends-backslash-p-1 () |
| 6129 | (python-tests-with-temp-buffer | 6167 | (python-tests-with-temp-buffer |
| 6130 | " | 6168 | " |