diff options
| author | Fabián Ezequiel Gallina | 2013-12-25 15:07:31 -0300 |
|---|---|---|
| committer | Fabián Ezequiel Gallina | 2013-12-25 15:07:31 -0300 |
| commit | 0137922173eb3655aa0d9787991ecb62602e47c9 (patch) | |
| tree | dc87f15582fdd36b745acb750cb5e96004d8c5e3 /test/automated/python-tests.el | |
| parent | 99e4926fcbee9f7e75ed19b194fa7a2aa59c98c1 (diff) | |
| download | emacs-0137922173eb3655aa0d9787991ecb62602e47c9.tar.gz emacs-0137922173eb3655aa0d9787991ecb62602e47c9.zip | |
* lisp/progmodes/python.el:
(python-nav--lisp-forward-sexp): New function.
(python-nav--lisp-forward-sexp-safe): Use it. Rename from
python-nav-lisp-forward-sexp-safe.
(python-nav--forward-sexp): New argument SAFE allows switching
forward sexp movement behavior for parens.
(python-nav-forward-sexp): Throw errors on unterminated parens.
(python-nav-backward-sexp, python-nav-forward-sexp-safe)
(python-nav-backward-sexp-safe): New functions.
(python-shell-buffer-substring): Use
`python-nav-forward-sexp-safe'.
* test/automated/python-tests.el
(python-nav-lisp-forward-sexp-safe-1): Remove test.
(python-nav-forward-sexp-safe-1): New test.
Fixes: debbugs:16191
Diffstat (limited to 'test/automated/python-tests.el')
| -rw-r--r-- | test/automated/python-tests.el | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el index 5756507fc92..03667a74666 100644 --- a/test/automated/python-tests.el +++ b/test/automated/python-tests.el | |||
| @@ -1339,28 +1339,6 @@ if request.user.is_authenticated(): | |||
| 1339 | (python-tests-look-at | 1339 | (python-tests-look-at |
| 1340 | "if request.user.is_authenticated():" -1))))) | 1340 | "if request.user.is_authenticated():" -1))))) |
| 1341 | 1341 | ||
| 1342 | (ert-deftest python-nav-lisp-forward-sexp-safe-1 () | ||
| 1343 | (python-tests-with-temp-buffer | ||
| 1344 | " | ||
| 1345 | profile = Profile.objects.create(user=request.user) | ||
| 1346 | profile.notify() | ||
| 1347 | " | ||
| 1348 | (python-tests-look-at "profile =") | ||
| 1349 | (python-nav-lisp-forward-sexp-safe 4) | ||
| 1350 | (should (looking-at "(user=request.user)")) | ||
| 1351 | (python-tests-look-at "user=request.user") | ||
| 1352 | (python-nav-lisp-forward-sexp-safe -1) | ||
| 1353 | (should (looking-at "(user=request.user)")) | ||
| 1354 | (python-nav-lisp-forward-sexp-safe -4) | ||
| 1355 | (should (looking-at "profile =")) | ||
| 1356 | (python-tests-look-at "user=request.user") | ||
| 1357 | (python-nav-lisp-forward-sexp-safe 3) | ||
| 1358 | (should (looking-at ")")) | ||
| 1359 | (python-nav-lisp-forward-sexp-safe 1) | ||
| 1360 | (should (looking-at "$")) | ||
| 1361 | (python-nav-lisp-forward-sexp-safe 1) | ||
| 1362 | (should (looking-at ".notify()")))) | ||
| 1363 | |||
| 1364 | (ert-deftest python-nav-forward-sexp-1 () | 1342 | (ert-deftest python-nav-forward-sexp-1 () |
| 1365 | (python-tests-with-temp-buffer | 1343 | (python-tests-with-temp-buffer |
| 1366 | " | 1344 | " |
| @@ -1477,6 +1455,29 @@ def another_statement(): | |||
| 1477 | (python-nav-forward-sexp -1) | 1455 | (python-nav-forward-sexp -1) |
| 1478 | (should (looking-at "from some_module import some_sub_module")))) | 1456 | (should (looking-at "from some_module import some_sub_module")))) |
| 1479 | 1457 | ||
| 1458 | (ert-deftest python-nav-forward-sexp-safe-1 () | ||
| 1459 | (python-tests-with-temp-buffer | ||
| 1460 | " | ||
| 1461 | profile = Profile.objects.create(user=request.user) | ||
| 1462 | profile.notify() | ||
| 1463 | " | ||
| 1464 | (python-tests-look-at "profile =") | ||
| 1465 | (python-nav-forward-sexp-safe 1) | ||
| 1466 | (should (looking-at "$")) | ||
| 1467 | (beginning-of-line 1) | ||
| 1468 | (python-tests-look-at "user=request.user") | ||
| 1469 | (python-nav-forward-sexp-safe -1) | ||
| 1470 | (should (looking-at "(user=request.user)")) | ||
| 1471 | (python-nav-forward-sexp-safe -4) | ||
| 1472 | (should (looking-at "profile =")) | ||
| 1473 | (python-tests-look-at "user=request.user") | ||
| 1474 | (python-nav-forward-sexp-safe 3) | ||
| 1475 | (should (looking-at ")")) | ||
| 1476 | (python-nav-forward-sexp-safe 1) | ||
| 1477 | (should (looking-at "$")) | ||
| 1478 | (python-nav-forward-sexp-safe 1) | ||
| 1479 | (should (looking-at "$")))) | ||
| 1480 | |||
| 1480 | (ert-deftest python-nav-up-list-1 () | 1481 | (ert-deftest python-nav-up-list-1 () |
| 1481 | (python-tests-with-temp-buffer | 1482 | (python-tests-with-temp-buffer |
| 1482 | " | 1483 | " |