diff options
Diffstat (limited to 'test/automated/python-tests.el')
| -rw-r--r-- | test/automated/python-tests.el | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el index e792b0f1a1a..30b1b480a25 100644 --- a/test/automated/python-tests.el +++ b/test/automated/python-tests.el | |||
| @@ -3276,6 +3276,61 @@ class Foo(models.Model): | |||
| 3276 | 3276 | ||
| 3277 | ")))) | 3277 | ")))) |
| 3278 | 3278 | ||
| 3279 | (ert-deftest python-shell-buffer-substring-10 () | ||
| 3280 | "Check substring from partial block." | ||
| 3281 | (python-tests-with-temp-buffer | ||
| 3282 | " | ||
| 3283 | def foo(): | ||
| 3284 | print ('a') | ||
| 3285 | " | ||
| 3286 | (should (string= (python-shell-buffer-substring | ||
| 3287 | (python-tests-look-at "print ('a')") | ||
| 3288 | (point-max)) | ||
| 3289 | "if True: | ||
| 3290 | |||
| 3291 | print ('a') | ||
| 3292 | ")))) | ||
| 3293 | |||
| 3294 | (ert-deftest python-shell-buffer-substring-11 () | ||
| 3295 | "Check substring from partial block and point within indentation." | ||
| 3296 | (python-tests-with-temp-buffer | ||
| 3297 | " | ||
| 3298 | def foo(): | ||
| 3299 | print ('a') | ||
| 3300 | " | ||
| 3301 | (should (string= (python-shell-buffer-substring | ||
| 3302 | (progn | ||
| 3303 | (python-tests-look-at "print ('a')") | ||
| 3304 | (backward-char 1) | ||
| 3305 | (point)) | ||
| 3306 | (point-max)) | ||
| 3307 | "if True: | ||
| 3308 | |||
| 3309 | print ('a') | ||
| 3310 | ")))) | ||
| 3311 | |||
| 3312 | (ert-deftest python-shell-buffer-substring-12 () | ||
| 3313 | "Check substring from partial block and point in whitespace." | ||
| 3314 | (python-tests-with-temp-buffer | ||
| 3315 | " | ||
| 3316 | def foo(): | ||
| 3317 | |||
| 3318 | # Whitespace | ||
| 3319 | |||
| 3320 | print ('a') | ||
| 3321 | " | ||
| 3322 | (should (string= (python-shell-buffer-substring | ||
| 3323 | (python-tests-look-at "# Whitespace") | ||
| 3324 | (point-max)) | ||
| 3325 | "if True: | ||
| 3326 | |||
| 3327 | |||
| 3328 | # Whitespace | ||
| 3329 | |||
| 3330 | print ('a') | ||
| 3331 | ")))) | ||
| 3332 | |||
| 3333 | |||
| 3279 | 3334 | ||
| 3280 | ;;; Shell completion | 3335 | ;;; Shell completion |
| 3281 | 3336 | ||