diff options
| author | Paul Eggert | 2017-11-13 10:54:20 -0800 |
|---|---|---|
| committer | Paul Eggert | 2017-11-13 10:54:20 -0800 |
| commit | 99ceefa8ec4f9993663492cfcce6bb82a94569c1 (patch) | |
| tree | 507f76715b3086f34672b7c984dc09befaa57fc6 /test | |
| parent | a7b7b85567f766ff510a5eaaaf32dbbbec15efd0 (diff) | |
| parent | 79108894dbcd642121466bb6af6c98c6a56e9233 (diff) | |
| download | emacs-99ceefa8ec4f9993663492cfcce6bb82a94569c1.tar.gz emacs-99ceefa8ec4f9993663492cfcce6bb82a94569c1.zip | |
Merge from origin/emacs-26
79108894db Port to IBM xlc 12.01
d14956099d Simplify by removing HAVE_STRUCT_ATTRIBUTE_ALIGNED
b1573a97e1 Use alignas to fix GCALIGN-related bugs
5d68dc9a2f Change vectorlike from struct to union
6aa0a26b46 Don't enable cursor-sensor-mode in mhtml-mode
2b8ef8dddf * lisp/files.el (abbreviate-file-name): Doc fix. (Bug#29267)
fe85ce1e16 Unbreak interactive run of a flymake test (bug#29267)
48ad00390d Fix Bug#29225
42daf83f08 CC Mode: Fix defun-open being recognized as brace-list-ope...
7775c47298 Merge from Gnulib
e470d16448 Pacify GCC when configured --with-x-toolkit=no
49450d0951 * lisp/find-dired.el (find-grep-dired): Doc fix. (Bug#29262)
e286b3381f Fix more flymake-diag-region eob corner cases and add test...
# Conflicts:
# src/lisp.h
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 251 | ||||
| -rw-r--r-- | test/lisp/progmodes/flymake-tests.el | 37 |
2 files changed, 250 insertions, 38 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 5a7134f5f53..7a7cf933fa3 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -1878,7 +1878,7 @@ This checks also `file-name-as-directory', `file-name-directory', | |||
| 1878 | "Check `copy-file'." | 1878 | "Check `copy-file'." |
| 1879 | (skip-unless (tramp--test-enabled)) | 1879 | (skip-unless (tramp--test-enabled)) |
| 1880 | 1880 | ||
| 1881 | ;; TODO: The quoted case does not work. | 1881 | ;; TODO: The quoted case does not work. Copy local file to remote. |
| 1882 | ;;(dolist (quoted (if tramp--test-expensive-test '(nil t) '(nil))) | 1882 | ;;(dolist (quoted (if tramp--test-expensive-test '(nil t) '(nil))) |
| 1883 | (let (quoted) | 1883 | (let (quoted) |
| 1884 | (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) | 1884 | (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) |
| @@ -2921,7 +2921,188 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 2921 | ;; Cleanup. | 2921 | ;; Cleanup. |
| 2922 | (ignore-errors (delete-file tmp-name)))))) | 2922 | (ignore-errors (delete-file tmp-name)))))) |
| 2923 | 2923 | ||
| 2924 | (ert-deftest tramp-test24-file-name-completion () | 2924 | (ert-deftest tramp-test24-file-acl () |
| 2925 | "Check that `file-acl' and `set-file-acl' work proper." | ||
| 2926 | (skip-unless (tramp--test-enabled)) | ||
| 2927 | (skip-unless (file-acl tramp-test-temporary-file-directory)) | ||
| 2928 | |||
| 2929 | ;; TODO: The quoted case does not work. Copy local file to remote. | ||
| 2930 | ;;(dolist (quoted (if tramp--test-expensive-test '(nil t) '(nil))) | ||
| 2931 | (let (quoted) | ||
| 2932 | (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) | ||
| 2933 | (tmp-name2 (tramp--test-make-temp-name nil quoted)) | ||
| 2934 | (tmp-name3 (tramp--test-make-temp-name 'local quoted))) | ||
| 2935 | ;; Both files are remote. | ||
| 2936 | (unwind-protect | ||
| 2937 | (progn | ||
| 2938 | ;; Two files with same ACLs. | ||
| 2939 | (write-region "foo" nil tmp-name1) | ||
| 2940 | (should (file-exists-p tmp-name1)) | ||
| 2941 | (should (file-acl tmp-name1)) | ||
| 2942 | (copy-file tmp-name1 tmp-name2) | ||
| 2943 | (should (file-acl tmp-name2)) | ||
| 2944 | (should (string-equal (file-acl tmp-name1) (file-acl tmp-name2))) | ||
| 2945 | ;; Different permissions mean different ACLs. | ||
| 2946 | (set-file-modes tmp-name1 #o777) | ||
| 2947 | (set-file-modes tmp-name2 #o444) | ||
| 2948 | (should-not | ||
| 2949 | (string-equal (file-acl tmp-name1) (file-acl tmp-name2))) | ||
| 2950 | ;; Copy ACL. | ||
| 2951 | (should (set-file-acl tmp-name2 (file-acl tmp-name1))) | ||
| 2952 | (should (string-equal (file-acl tmp-name1) (file-acl tmp-name2))) | ||
| 2953 | ;; An invalid ACL does not harm. | ||
| 2954 | (should-not (set-file-acl tmp-name2 "foo"))) | ||
| 2955 | |||
| 2956 | ;; Cleanup. | ||
| 2957 | (ignore-errors (delete-file tmp-name1)) | ||
| 2958 | (ignore-errors (delete-file tmp-name2))) | ||
| 2959 | |||
| 2960 | ;; Remote and local file. | ||
| 2961 | (unwind-protect | ||
| 2962 | (when (and (file-acl temporary-file-directory) | ||
| 2963 | (not (tramp--test-windows-nt-or-smb-p))) | ||
| 2964 | ;; Two files with same ACLs. | ||
| 2965 | (write-region "foo" nil tmp-name1) | ||
| 2966 | (should (file-exists-p tmp-name1)) | ||
| 2967 | (should (file-acl tmp-name1)) | ||
| 2968 | (copy-file tmp-name1 tmp-name3) | ||
| 2969 | (should (file-acl tmp-name3)) | ||
| 2970 | (should (string-equal (file-acl tmp-name1) (file-acl tmp-name3))) | ||
| 2971 | ;; Different permissions mean different ACLs. | ||
| 2972 | (set-file-modes tmp-name1 #o777) | ||
| 2973 | (set-file-modes tmp-name3 #o444) | ||
| 2974 | (should-not | ||
| 2975 | (string-equal (file-acl tmp-name1) (file-acl tmp-name3))) | ||
| 2976 | ;; Copy ACL. | ||
| 2977 | (set-file-acl tmp-name3 (file-acl tmp-name1)) | ||
| 2978 | (should (string-equal (file-acl tmp-name1) (file-acl tmp-name3))) | ||
| 2979 | |||
| 2980 | ;; Two files with same ACLs. | ||
| 2981 | (delete-file tmp-name1) | ||
| 2982 | (copy-file tmp-name3 tmp-name1) | ||
| 2983 | (should (file-acl tmp-name1)) | ||
| 2984 | (should (string-equal (file-acl tmp-name1) (file-acl tmp-name3))) | ||
| 2985 | ;; Different permissions mean different ACLs. | ||
| 2986 | (set-file-modes tmp-name1 #o777) | ||
| 2987 | (set-file-modes tmp-name3 #o444) | ||
| 2988 | (should-not | ||
| 2989 | (string-equal (file-acl tmp-name1) (file-acl tmp-name3))) | ||
| 2990 | ;; Copy ACL. | ||
| 2991 | (set-file-acl tmp-name1 (file-acl tmp-name3)) | ||
| 2992 | (should (string-equal (file-acl tmp-name1) (file-acl tmp-name3)))) | ||
| 2993 | |||
| 2994 | ;; Cleanup. | ||
| 2995 | (ignore-errors (delete-file tmp-name1)) | ||
| 2996 | (ignore-errors (delete-file tmp-name3)))))) | ||
| 2997 | |||
| 2998 | ;; TODO: This test didn't run in reality yet. Pls report if it | ||
| 2999 | ;; doesn't work as expected. | ||
| 3000 | (ert-deftest tramp-test25-file-selinux () | ||
| 3001 | "Check `file-selinux-context' and `set-file-selinux-context'." | ||
| 3002 | (skip-unless (tramp--test-enabled)) | ||
| 3003 | (skip-unless | ||
| 3004 | (not (equal (file-selinux-context tramp-test-temporary-file-directory) | ||
| 3005 | '(nil nil nil nil)))) | ||
| 3006 | |||
| 3007 | ;; TODO: The quoted case does not work. Copy local file to remote. | ||
| 3008 | ;;(dolist (quoted (if tramp--test-expensive-test '(nil t) '(nil))) | ||
| 3009 | (let (quoted) | ||
| 3010 | (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) | ||
| 3011 | (tmp-name2 (tramp--test-make-temp-name nil quoted)) | ||
| 3012 | (tmp-name3 (tramp--test-make-temp-name 'local quoted))) | ||
| 3013 | ;; Both files are remote. | ||
| 3014 | (unwind-protect | ||
| 3015 | (progn | ||
| 3016 | ;; Two files with same SELINUX context. | ||
| 3017 | (write-region "foo" nil tmp-name1) | ||
| 3018 | (should (file-exists-p tmp-name1)) | ||
| 3019 | (should (file-selinux-context tmp-name1)) | ||
| 3020 | (copy-file tmp-name1 tmp-name2) | ||
| 3021 | (should (file-selinux-context tmp-name2)) | ||
| 3022 | (should | ||
| 3023 | (equal | ||
| 3024 | (file-selinux-context tmp-name1) | ||
| 3025 | (file-selinux-context tmp-name2))) | ||
| 3026 | ;; Different permissions mean different SELINUX context. | ||
| 3027 | (set-file-modes tmp-name1 #o777) | ||
| 3028 | (set-file-modes tmp-name2 #o444) | ||
| 3029 | (should-not | ||
| 3030 | (equal | ||
| 3031 | (file-selinux-context tmp-name1) | ||
| 3032 | (file-selinux-context tmp-name2))) | ||
| 3033 | ;; Copy SELINUX context. | ||
| 3034 | (should | ||
| 3035 | (set-file-selinux-context | ||
| 3036 | tmp-name2 (file-selinux-context tmp-name1))) | ||
| 3037 | (should | ||
| 3038 | (equal | ||
| 3039 | (file-selinux-context tmp-name1) | ||
| 3040 | (file-selinux-context tmp-name2))) | ||
| 3041 | ;; An invalid SELINUX context does not harm. | ||
| 3042 | (should-not (set-file-selinux-context tmp-name2 "foo"))) | ||
| 3043 | |||
| 3044 | ;; Cleanup. | ||
| 3045 | (ignore-errors (delete-file tmp-name1)) | ||
| 3046 | (ignore-errors (delete-file tmp-name2))) | ||
| 3047 | |||
| 3048 | ;; Remote and local file. | ||
| 3049 | (unwind-protect | ||
| 3050 | (when (not (or (equal (file-selinux-context temporary-file-directory) | ||
| 3051 | '(nil nil nil nil)) | ||
| 3052 | (tramp--test-windows-nt-or-smb-p))) | ||
| 3053 | ;; Two files with same SELINUX context. | ||
| 3054 | (write-region "foo" nil tmp-name1) | ||
| 3055 | (should (file-exists-p tmp-name1)) | ||
| 3056 | (should (file-selinux-context tmp-name1)) | ||
| 3057 | (copy-file tmp-name1 tmp-name3) | ||
| 3058 | (should (file-selinux-context tmp-name3)) | ||
| 3059 | (should | ||
| 3060 | (equal | ||
| 3061 | (file-selinux-context tmp-name1) | ||
| 3062 | (file-selinux-context tmp-name3))) | ||
| 3063 | ;; Different permissions mean different SELINUX context. | ||
| 3064 | (set-file-modes tmp-name1 #o777) | ||
| 3065 | (set-file-modes tmp-name3 #o444) | ||
| 3066 | (should-not | ||
| 3067 | (equal | ||
| 3068 | (file-selinux-context tmp-name1) | ||
| 3069 | (file-selinux-context tmp-name3))) | ||
| 3070 | ;; Copy SELINUX context. | ||
| 3071 | (set-file-selinux-context | ||
| 3072 | tmp-name3 (file-selinux-context tmp-name1)) | ||
| 3073 | (should | ||
| 3074 | (equal | ||
| 3075 | (file-selinux-context tmp-name1) | ||
| 3076 | (file-selinux-context tmp-name3))) | ||
| 3077 | |||
| 3078 | ;; Two files with same SELINUX context. | ||
| 3079 | (delete-file tmp-name1) | ||
| 3080 | (copy-file tmp-name3 tmp-name1) | ||
| 3081 | (should (file-selinux-context tmp-name1)) | ||
| 3082 | (should | ||
| 3083 | (equal | ||
| 3084 | (file-selinux-context tmp-name1) | ||
| 3085 | (file-selinux-context tmp-name3))) | ||
| 3086 | ;; Different permissions mean different SELINUX context. | ||
| 3087 | (set-file-modes tmp-name1 #o777) | ||
| 3088 | (set-file-modes tmp-name3 #o444) | ||
| 3089 | (should-not | ||
| 3090 | (equal | ||
| 3091 | (file-selinux-context tmp-name1) | ||
| 3092 | (file-selinux-context tmp-name3))) | ||
| 3093 | ;; Copy SELINUX context. | ||
| 3094 | (set-file-selinux-context | ||
| 3095 | tmp-name1 (file-selinux-context tmp-name2)) | ||
| 3096 | (should | ||
| 3097 | (equal | ||
| 3098 | (file-selinux-context tmp-name1) | ||
| 3099 | (file-selinux-context tmp-name3)))) | ||
| 3100 | |||
| 3101 | ;; Cleanup. | ||
| 3102 | (ignore-errors (delete-file tmp-name1)) | ||
| 3103 | (ignore-errors (delete-file tmp-name3)))))) | ||
| 3104 | |||
| 3105 | (ert-deftest tramp-test26-file-name-completion () | ||
| 2925 | "Check `file-name-completion' and `file-name-all-completions'." | 3106 | "Check `file-name-completion' and `file-name-all-completions'." |
| 2926 | (skip-unless (tramp--test-enabled)) | 3107 | (skip-unless (tramp--test-enabled)) |
| 2927 | 3108 | ||
| @@ -3046,7 +3227,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3046 | ;; Cleanup. | 3227 | ;; Cleanup. |
| 3047 | (ignore-errors (delete-directory tmp-name 'recursive))))))) | 3228 | (ignore-errors (delete-directory tmp-name 'recursive))))))) |
| 3048 | 3229 | ||
| 3049 | (ert-deftest tramp-test25-load () | 3230 | (ert-deftest tramp-test27-load () |
| 3050 | "Check `load'." | 3231 | "Check `load'." |
| 3051 | (skip-unless (tramp--test-enabled)) | 3232 | (skip-unless (tramp--test-enabled)) |
| 3052 | 3233 | ||
| @@ -3069,7 +3250,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3069 | (and (featurep 'tramp-test-load) (unload-feature 'tramp-test-load)) | 3250 | (and (featurep 'tramp-test-load) (unload-feature 'tramp-test-load)) |
| 3070 | (delete-file tmp-name)))))) | 3251 | (delete-file tmp-name)))))) |
| 3071 | 3252 | ||
| 3072 | (ert-deftest tramp-test26-process-file () | 3253 | (ert-deftest tramp-test28-process-file () |
| 3073 | "Check `process-file'." | 3254 | "Check `process-file'." |
| 3074 | :tags '(:expensive-test) | 3255 | :tags '(:expensive-test) |
| 3075 | (skip-unless (tramp--test-enabled)) | 3256 | (skip-unless (tramp--test-enabled)) |
| @@ -3115,7 +3296,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3115 | ;; Cleanup. | 3296 | ;; Cleanup. |
| 3116 | (ignore-errors (delete-file tmp-name)))))) | 3297 | (ignore-errors (delete-file tmp-name)))))) |
| 3117 | 3298 | ||
| 3118 | (ert-deftest tramp-test27-start-file-process () | 3299 | (ert-deftest tramp-test29-start-file-process () |
| 3119 | "Check `start-file-process'." | 3300 | "Check `start-file-process'." |
| 3120 | :tags '(:expensive-test) | 3301 | :tags '(:expensive-test) |
| 3121 | (skip-unless (tramp--test-enabled)) | 3302 | (skip-unless (tramp--test-enabled)) |
| @@ -3180,7 +3361,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3180 | ;; Cleanup. | 3361 | ;; Cleanup. |
| 3181 | (ignore-errors (delete-process proc)))))) | 3362 | (ignore-errors (delete-process proc)))))) |
| 3182 | 3363 | ||
| 3183 | (ert-deftest tramp-test28-interrupt-process () | 3364 | (ert-deftest tramp-test30-interrupt-process () |
| 3184 | "Check `interrupt-process'." | 3365 | "Check `interrupt-process'." |
| 3185 | :tags '(:expensive-test) | 3366 | :tags '(:expensive-test) |
| 3186 | (skip-unless (tramp--test-enabled)) | 3367 | (skip-unless (tramp--test-enabled)) |
| @@ -3207,7 +3388,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3207 | ;; Cleanup. | 3388 | ;; Cleanup. |
| 3208 | (ignore-errors (delete-process proc))))) | 3389 | (ignore-errors (delete-process proc))))) |
| 3209 | 3390 | ||
| 3210 | (ert-deftest tramp-test29-shell-command () | 3391 | (ert-deftest tramp-test31-shell-command () |
| 3211 | "Check `shell-command'." | 3392 | "Check `shell-command'." |
| 3212 | :tags '(:expensive-test) | 3393 | :tags '(:expensive-test) |
| 3213 | (skip-unless (tramp--test-enabled)) | 3394 | (skip-unless (tramp--test-enabled)) |
| @@ -3311,7 +3492,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3311 | (buffer-substring-no-properties (point-min) (point-max)))) | 3492 | (buffer-substring-no-properties (point-min) (point-max)))) |
| 3312 | 3493 | ||
| 3313 | ;; This test is inspired by Bug#23952. | 3494 | ;; This test is inspired by Bug#23952. |
| 3314 | (ert-deftest tramp-test30-environment-variables () | 3495 | (ert-deftest tramp-test32-environment-variables () |
| 3315 | "Check that remote processes set / unset environment variables properly." | 3496 | "Check that remote processes set / unset environment variables properly." |
| 3316 | :tags '(:expensive-test) | 3497 | :tags '(:expensive-test) |
| 3317 | (skip-unless (tramp--test-enabled)) | 3498 | (skip-unless (tramp--test-enabled)) |
| @@ -3389,7 +3570,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3389 | (funcall this-shell-command-to-string "set"))))))))) | 3570 | (funcall this-shell-command-to-string "set"))))))))) |
| 3390 | 3571 | ||
| 3391 | ;; This test is inspired by Bug#27009. | 3572 | ;; This test is inspired by Bug#27009. |
| 3392 | (ert-deftest tramp-test30-environment-variables-and-port-numbers () | 3573 | (ert-deftest tramp-test32-environment-variables-and-port-numbers () |
| 3393 | "Check that two connections with separate ports are different." | 3574 | "Check that two connections with separate ports are different." |
| 3394 | (skip-unless (tramp--test-enabled)) | 3575 | (skip-unless (tramp--test-enabled)) |
| 3395 | ;; We test it only for the mock-up connection; otherwise there might | 3576 | ;; We test it only for the mock-up connection; otherwise there might |
| @@ -3428,7 +3609,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3428 | (tramp-cleanup-connection (tramp-dissect-file-name dir))))) | 3609 | (tramp-cleanup-connection (tramp-dissect-file-name dir))))) |
| 3429 | 3610 | ||
| 3430 | ;; The functions were introduced in Emacs 26.1. | 3611 | ;; The functions were introduced in Emacs 26.1. |
| 3431 | (ert-deftest tramp-test31-explicit-shell-file-name () | 3612 | (ert-deftest tramp-test33-explicit-shell-file-name () |
| 3432 | "Check that connection-local `explicit-shell-file-name' is set." | 3613 | "Check that connection-local `explicit-shell-file-name' is set." |
| 3433 | :tags '(:expensive-test) | 3614 | :tags '(:expensive-test) |
| 3434 | (skip-unless (tramp--test-enabled)) | 3615 | (skip-unless (tramp--test-enabled)) |
| @@ -3472,7 +3653,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3472 | (put 'explicit-shell-file-name 'permanent-local nil) | 3653 | (put 'explicit-shell-file-name 'permanent-local nil) |
| 3473 | (kill-buffer "*shell*")))) | 3654 | (kill-buffer "*shell*")))) |
| 3474 | 3655 | ||
| 3475 | (ert-deftest tramp-test32-vc-registered () | 3656 | (ert-deftest tramp-test34-vc-registered () |
| 3476 | "Check `vc-registered'." | 3657 | "Check `vc-registered'." |
| 3477 | :tags '(:expensive-test) | 3658 | :tags '(:expensive-test) |
| 3478 | (skip-unless (tramp--test-enabled)) | 3659 | (skip-unless (tramp--test-enabled)) |
| @@ -3544,7 +3725,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3544 | ;; Cleanup. | 3725 | ;; Cleanup. |
| 3545 | (ignore-errors (delete-directory tmp-name1 'recursive)))))) | 3726 | (ignore-errors (delete-directory tmp-name1 'recursive)))))) |
| 3546 | 3727 | ||
| 3547 | (ert-deftest tramp-test33-make-auto-save-file-name () | 3728 | (ert-deftest tramp-test35-make-auto-save-file-name () |
| 3548 | "Check `make-auto-save-file-name'." | 3729 | "Check `make-auto-save-file-name'." |
| 3549 | (skip-unless (tramp--test-enabled)) | 3730 | (skip-unless (tramp--test-enabled)) |
| 3550 | 3731 | ||
| @@ -3638,7 +3819,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3638 | (ignore-errors (delete-file tmp-name1)) | 3819 | (ignore-errors (delete-file tmp-name1)) |
| 3639 | (ignore-errors (delete-directory tmp-name2 'recursive)))))) | 3820 | (ignore-errors (delete-directory tmp-name2 'recursive)))))) |
| 3640 | 3821 | ||
| 3641 | (ert-deftest tramp-test34-find-backup-file-name () | 3822 | (ert-deftest tramp-test36-find-backup-file-name () |
| 3642 | "Check `find-backup-file-name'." | 3823 | "Check `find-backup-file-name'." |
| 3643 | (skip-unless (tramp--test-enabled)) | 3824 | (skip-unless (tramp--test-enabled)) |
| 3644 | 3825 | ||
| @@ -3734,7 +3915,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3734 | (ignore-errors (delete-directory tmp-name2 'recursive)))))) | 3915 | (ignore-errors (delete-directory tmp-name2 'recursive)))))) |
| 3735 | 3916 | ||
| 3736 | ;; The functions were introduced in Emacs 26.1. | 3917 | ;; The functions were introduced in Emacs 26.1. |
| 3737 | (ert-deftest tramp-test35-make-nearby-temp-file () | 3918 | (ert-deftest tramp-test37-make-nearby-temp-file () |
| 3738 | "Check `make-nearby-temp-file' and `temporary-file-directory'." | 3919 | "Check `make-nearby-temp-file' and `temporary-file-directory'." |
| 3739 | (skip-unless (tramp--test-enabled)) | 3920 | (skip-unless (tramp--test-enabled)) |
| 3740 | ;; Since Emacs 26.1. | 3921 | ;; Since Emacs 26.1. |
| @@ -3999,7 +4180,7 @@ This requires restrictions of file name syntax." | |||
| 3999 | (ignore-errors (delete-directory tmp-name2 'recursive)))))) | 4180 | (ignore-errors (delete-directory tmp-name2 'recursive)))))) |
| 4000 | 4181 | ||
| 4001 | (defun tramp--test-special-characters () | 4182 | (defun tramp--test-special-characters () |
| 4002 | "Perform the test in `tramp-test36-special-characters*'." | 4183 | "Perform the test in `tramp-test38-special-characters*'." |
| 4003 | ;; Newlines, slashes and backslashes in file names are not | 4184 | ;; Newlines, slashes and backslashes in file names are not |
| 4004 | ;; supported. So we don't test. And we don't test the tab | 4185 | ;; supported. So we don't test. And we don't test the tab |
| 4005 | ;; character on Windows or Cygwin, because the backslash is | 4186 | ;; character on Windows or Cygwin, because the backslash is |
| @@ -4042,7 +4223,7 @@ This requires restrictions of file name syntax." | |||
| 4042 | "{foo}bar{baz}")) | 4223 | "{foo}bar{baz}")) |
| 4043 | 4224 | ||
| 4044 | ;; These tests are inspired by Bug#17238. | 4225 | ;; These tests are inspired by Bug#17238. |
| 4045 | (ert-deftest tramp-test36-special-characters () | 4226 | (ert-deftest tramp-test38-special-characters () |
| 4046 | "Check special characters in file names." | 4227 | "Check special characters in file names." |
| 4047 | (skip-unless (tramp--test-enabled)) | 4228 | (skip-unless (tramp--test-enabled)) |
| 4048 | (skip-unless (not (tramp--test-rsync-p))) | 4229 | (skip-unless (not (tramp--test-rsync-p))) |
| @@ -4050,7 +4231,7 @@ This requires restrictions of file name syntax." | |||
| 4050 | 4231 | ||
| 4051 | (tramp--test-special-characters)) | 4232 | (tramp--test-special-characters)) |
| 4052 | 4233 | ||
| 4053 | (ert-deftest tramp-test36-special-characters-with-stat () | 4234 | (ert-deftest tramp-test38-special-characters-with-stat () |
| 4054 | "Check special characters in file names. | 4235 | "Check special characters in file names. |
| 4055 | Use the `stat' command." | 4236 | Use the `stat' command." |
| 4056 | :tags '(:expensive-test) | 4237 | :tags '(:expensive-test) |
| @@ -4068,7 +4249,7 @@ Use the `stat' command." | |||
| 4068 | tramp-connection-properties))) | 4249 | tramp-connection-properties))) |
| 4069 | (tramp--test-special-characters))) | 4250 | (tramp--test-special-characters))) |
| 4070 | 4251 | ||
| 4071 | (ert-deftest tramp-test36-special-characters-with-perl () | 4252 | (ert-deftest tramp-test38-special-characters-with-perl () |
| 4072 | "Check special characters in file names. | 4253 | "Check special characters in file names. |
| 4073 | Use the `perl' command." | 4254 | Use the `perl' command." |
| 4074 | :tags '(:expensive-test) | 4255 | :tags '(:expensive-test) |
| @@ -4089,7 +4270,7 @@ Use the `perl' command." | |||
| 4089 | tramp-connection-properties))) | 4270 | tramp-connection-properties))) |
| 4090 | (tramp--test-special-characters))) | 4271 | (tramp--test-special-characters))) |
| 4091 | 4272 | ||
| 4092 | (ert-deftest tramp-test36-special-characters-with-ls () | 4273 | (ert-deftest tramp-test38-special-characters-with-ls () |
| 4093 | "Check special characters in file names. | 4274 | "Check special characters in file names. |
| 4094 | Use the `ls' command." | 4275 | Use the `ls' command." |
| 4095 | :tags '(:expensive-test) | 4276 | :tags '(:expensive-test) |
| @@ -4112,7 +4293,7 @@ Use the `ls' command." | |||
| 4112 | (tramp--test-special-characters))) | 4293 | (tramp--test-special-characters))) |
| 4113 | 4294 | ||
| 4114 | (defun tramp--test-utf8 () | 4295 | (defun tramp--test-utf8 () |
| 4115 | "Perform the test in `tramp-test37-utf8*'." | 4296 | "Perform the test in `tramp-test39-utf8*'." |
| 4116 | (let* ((utf8 (if (and (eq system-type 'darwin) | 4297 | (let* ((utf8 (if (and (eq system-type 'darwin) |
| 4117 | (memq 'utf-8-hfs (coding-system-list))) | 4298 | (memq 'utf-8-hfs (coding-system-list))) |
| 4118 | 'utf-8-hfs 'utf-8)) | 4299 | 'utf-8-hfs 'utf-8)) |
| @@ -4127,7 +4308,7 @@ Use the `ls' command." | |||
| 4127 | "银河系漫游指南系列" | 4308 | "银河系漫游指南系列" |
| 4128 | "Автостопом по гала́ктике"))) | 4309 | "Автостопом по гала́ктике"))) |
| 4129 | 4310 | ||
| 4130 | (ert-deftest tramp-test37-utf8 () | 4311 | (ert-deftest tramp-test39-utf8 () |
| 4131 | "Check UTF8 encoding in file names and file contents." | 4312 | "Check UTF8 encoding in file names and file contents." |
| 4132 | (skip-unless (tramp--test-enabled)) | 4313 | (skip-unless (tramp--test-enabled)) |
| 4133 | (skip-unless (not (tramp--test-docker-p))) | 4314 | (skip-unless (not (tramp--test-docker-p))) |
| @@ -4137,7 +4318,7 @@ Use the `ls' command." | |||
| 4137 | 4318 | ||
| 4138 | (tramp--test-utf8)) | 4319 | (tramp--test-utf8)) |
| 4139 | 4320 | ||
| 4140 | (ert-deftest tramp-test37-utf8-with-stat () | 4321 | (ert-deftest tramp-test39-utf8-with-stat () |
| 4141 | "Check UTF8 encoding in file names and file contents. | 4322 | "Check UTF8 encoding in file names and file contents. |
| 4142 | Use the `stat' command." | 4323 | Use the `stat' command." |
| 4143 | :tags '(:expensive-test) | 4324 | :tags '(:expensive-test) |
| @@ -4157,7 +4338,7 @@ Use the `stat' command." | |||
| 4157 | tramp-connection-properties))) | 4338 | tramp-connection-properties))) |
| 4158 | (tramp--test-utf8))) | 4339 | (tramp--test-utf8))) |
| 4159 | 4340 | ||
| 4160 | (ert-deftest tramp-test37-utf8-with-perl () | 4341 | (ert-deftest tramp-test39-utf8-with-perl () |
| 4161 | "Check UTF8 encoding in file names and file contents. | 4342 | "Check UTF8 encoding in file names and file contents. |
| 4162 | Use the `perl' command." | 4343 | Use the `perl' command." |
| 4163 | :tags '(:expensive-test) | 4344 | :tags '(:expensive-test) |
| @@ -4180,7 +4361,7 @@ Use the `perl' command." | |||
| 4180 | tramp-connection-properties))) | 4361 | tramp-connection-properties))) |
| 4181 | (tramp--test-utf8))) | 4362 | (tramp--test-utf8))) |
| 4182 | 4363 | ||
| 4183 | (ert-deftest tramp-test37-utf8-with-ls () | 4364 | (ert-deftest tramp-test39-utf8-with-ls () |
| 4184 | "Check UTF8 encoding in file names and file contents. | 4365 | "Check UTF8 encoding in file names and file contents. |
| 4185 | Use the `ls' command." | 4366 | Use the `ls' command." |
| 4186 | :tags '(:expensive-test) | 4367 | :tags '(:expensive-test) |
| @@ -4203,7 +4384,7 @@ Use the `ls' command." | |||
| 4203 | tramp-connection-properties))) | 4384 | tramp-connection-properties))) |
| 4204 | (tramp--test-utf8))) | 4385 | (tramp--test-utf8))) |
| 4205 | 4386 | ||
| 4206 | (ert-deftest tramp-test38-file-system-info () | 4387 | (ert-deftest tramp-test40-file-system-info () |
| 4207 | "Check that `file-system-info' returns proper values." | 4388 | "Check that `file-system-info' returns proper values." |
| 4208 | (skip-unless (tramp--test-enabled)) | 4389 | (skip-unless (tramp--test-enabled)) |
| 4209 | ;; Since Emacs 27.1. | 4390 | ;; Since Emacs 27.1. |
| @@ -4225,7 +4406,7 @@ Use the `ls' command." | |||
| 4225 | (ert-fail (format "`%s' timed out" (ert-test-name (ert-running-test))))) | 4406 | (ert-fail (format "`%s' timed out" (ert-test-name (ert-running-test))))) |
| 4226 | 4407 | ||
| 4227 | ;; This test is inspired by Bug#16928. | 4408 | ;; This test is inspired by Bug#16928. |
| 4228 | (ert-deftest tramp-test39-asynchronous-requests () | 4409 | (ert-deftest tramp-test41-asynchronous-requests () |
| 4229 | "Check parallel asynchronous requests. | 4410 | "Check parallel asynchronous requests. |
| 4230 | Such requests could arrive from timers, process filters and | 4411 | Such requests could arrive from timers, process filters and |
| 4231 | process sentinels. They shall not disturb each other." | 4412 | process sentinels. They shall not disturb each other." |
| @@ -4382,7 +4563,7 @@ process sentinels. They shall not disturb each other." | |||
| 4382 | (ignore-errors (cancel-timer timer)) | 4563 | (ignore-errors (cancel-timer timer)) |
| 4383 | (ignore-errors (delete-directory tmp-name 'recursive))))))) | 4564 | (ignore-errors (delete-directory tmp-name 'recursive))))))) |
| 4384 | 4565 | ||
| 4385 | (ert-deftest tramp-test40-recursive-load () | 4566 | (ert-deftest tramp-test42-recursive-load () |
| 4386 | "Check that Tramp does not fail due to recursive load." | 4567 | "Check that Tramp does not fail due to recursive load." |
| 4387 | (skip-unless (tramp--test-enabled)) | 4568 | (skip-unless (tramp--test-enabled)) |
| 4388 | 4569 | ||
| @@ -4405,7 +4586,7 @@ process sentinels. They shall not disturb each other." | |||
| 4405 | (mapconcat 'shell-quote-argument load-path " -L ") | 4586 | (mapconcat 'shell-quote-argument load-path " -L ") |
| 4406 | (shell-quote-argument code)))))))) | 4587 | (shell-quote-argument code)))))))) |
| 4407 | 4588 | ||
| 4408 | (ert-deftest tramp-test41-remote-load-path () | 4589 | (ert-deftest tramp-test43-remote-load-path () |
| 4409 | "Check that Tramp autoloads its packages with remote `load-path'." | 4590 | "Check that Tramp autoloads its packages with remote `load-path'." |
| 4410 | ;; `tramp-cleanup-all-connections' is autoloaded from tramp-cmds.el. | 4591 | ;; `tramp-cleanup-all-connections' is autoloaded from tramp-cmds.el. |
| 4411 | ;; It shall still work, when a remote file name is in the | 4592 | ;; It shall still work, when a remote file name is in the |
| @@ -4428,7 +4609,7 @@ process sentinels. They shall not disturb each other." | |||
| 4428 | (mapconcat 'shell-quote-argument load-path " -L ") | 4609 | (mapconcat 'shell-quote-argument load-path " -L ") |
| 4429 | (shell-quote-argument code))))))) | 4610 | (shell-quote-argument code))))))) |
| 4430 | 4611 | ||
| 4431 | (ert-deftest tramp-test42-delay-load () | 4612 | (ert-deftest tramp-test44-delay-load () |
| 4432 | "Check that Tramp is loaded lazily, only when needed." | 4613 | "Check that Tramp is loaded lazily, only when needed." |
| 4433 | ;; Tramp is neither loaded at Emacs startup, nor when completing a | 4614 | ;; Tramp is neither loaded at Emacs startup, nor when completing a |
| 4434 | ;; non-Tramp file name like "/foo". Completing a Tramp-alike file | 4615 | ;; non-Tramp file name like "/foo". Completing a Tramp-alike file |
| @@ -4454,7 +4635,7 @@ process sentinels. They shall not disturb each other." | |||
| 4454 | (mapconcat 'shell-quote-argument load-path " -L ") | 4635 | (mapconcat 'shell-quote-argument load-path " -L ") |
| 4455 | (shell-quote-argument (format code tm))))))))) | 4636 | (shell-quote-argument (format code tm))))))))) |
| 4456 | 4637 | ||
| 4457 | (ert-deftest tramp-test43-unload () | 4638 | (ert-deftest tramp-test45-unload () |
| 4458 | "Check that Tramp and its subpackages unload completely. | 4639 | "Check that Tramp and its subpackages unload completely. |
| 4459 | Since it unloads Tramp, it shall be the last test to run." | 4640 | Since it unloads Tramp, it shall be the last test to run." |
| 4460 | :tags '(:expensive-test) | 4641 | :tags '(:expensive-test) |
| @@ -4504,18 +4685,14 @@ Since it unloads Tramp, it shall be the last test to run." | |||
| 4504 | 4685 | ||
| 4505 | ;; * dired-compress-file | 4686 | ;; * dired-compress-file |
| 4506 | ;; * dired-uncache | 4687 | ;; * dired-uncache |
| 4507 | ;; * file-acl | ||
| 4508 | ;; * file-name-case-insensitive-p | 4688 | ;; * file-name-case-insensitive-p |
| 4509 | ;; * file-selinux-context | ||
| 4510 | ;; * set-file-acl | ||
| 4511 | ;; * set-file-selinux-context | ||
| 4512 | 4689 | ||
| 4513 | ;; * Work on skipped tests. Make a comment, when it is impossible. | 4690 | ;; * Work on skipped tests. Make a comment, when it is impossible. |
| 4514 | ;; * Fix `tramp-test05-expand-file-name-relative' in `expand-file-name'. | 4691 | ;; * Fix `tramp-test05-expand-file-name-relative' in `expand-file-name'. |
| 4515 | ;; * Fix `tramp-test06-directory-file-name' for `ftp'. | 4692 | ;; * Fix `tramp-test06-directory-file-name' for `ftp'. |
| 4516 | ;; * Fix `tramp-test27-start-file-process' on MS Windows (`process-send-eof'?). | 4693 | ;; * Fix `tramp-test29-start-file-process' on MS Windows (`process-send-eof'?). |
| 4517 | ;; * Fix `tramp-test28-interrupt-process', timeout doesn't work reliably. | 4694 | ;; * Fix `tramp-test30-interrupt-process', timeout doesn't work reliably. |
| 4518 | ;; * Fix Bug#16928 in `tramp-test39-asynchronous-requests'. | 4695 | ;; * Fix Bug#16928 in `tramp-test41-asynchronous-requests'. |
| 4519 | 4696 | ||
| 4520 | (defun tramp-test-all (&optional interactive) | 4697 | (defun tramp-test-all (&optional interactive) |
| 4521 | "Run all tests for \\[tramp]." | 4698 | "Run all tests for \\[tramp]." |
diff --git a/test/lisp/progmodes/flymake-tests.el b/test/lisp/progmodes/flymake-tests.el index 05214e7a927..8eb180a5130 100644 --- a/test/lisp/progmodes/flymake-tests.el +++ b/test/lisp/progmodes/flymake-tests.el | |||
| @@ -124,7 +124,10 @@ SEVERITY-PREDICATE is used to setup | |||
| 124 | ;; Some versions of ruby fail if HOME doesn't exist (bug#29187). | 124 | ;; Some versions of ruby fail if HOME doesn't exist (bug#29187). |
| 125 | (let* ((tempdir (make-temp-file "flymake-tests-ruby" t)) | 125 | (let* ((tempdir (make-temp-file "flymake-tests-ruby" t)) |
| 126 | (process-environment (cons (format "HOME=%s" tempdir) | 126 | (process-environment (cons (format "HOME=%s" tempdir) |
| 127 | process-environment))) | 127 | process-environment)) |
| 128 | ;; And see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19657#20 | ||
| 129 | ;; for this particular yuckiness | ||
| 130 | (abbreviated-home-dir nil)) | ||
| 128 | (unwind-protect | 131 | (unwind-protect |
| 129 | (flymake-tests--with-flymake ("test.rb") | 132 | (flymake-tests--with-flymake ("test.rb") |
| 130 | (flymake-goto-next-error) | 133 | (flymake-goto-next-error) |
| @@ -333,6 +336,38 @@ SEVERITY-PREDICATE is used to setup | |||
| 333 | (should-error (flymake-goto-prev-error nil nil t)) | 336 | (should-error (flymake-goto-prev-error nil nil t)) |
| 334 | ))))) | 337 | ))))) |
| 335 | 338 | ||
| 339 | (ert-deftest eob-region-and-trailing-newline () | ||
| 340 | "`flymake-diag-region' at eob with varying trailing newlines." | ||
| 341 | (cl-flet ((diag-region-substring | ||
| 342 | (line col) | ||
| 343 | (pcase-let | ||
| 344 | ((`(,a . ,b) (flymake-diag-region (current-buffer) line col))) | ||
| 345 | (buffer-substring a b)))) | ||
| 346 | (with-temp-buffer | ||
| 347 | (insert "beg\nmmm\nend") | ||
| 348 | (should (equal | ||
| 349 | (diag-region-substring 3 3) | ||
| 350 | "d")) | ||
| 351 | (should (equal | ||
| 352 | (diag-region-substring 3 nil) | ||
| 353 | "end")) | ||
| 354 | (insert "\n") | ||
| 355 | (should (equal | ||
| 356 | (diag-region-substring 4 1) | ||
| 357 | "end")) | ||
| 358 | (should (equal | ||
| 359 | (diag-region-substring 4 nil) | ||
| 360 | "end")) | ||
| 361 | (insert "\n") | ||
| 362 | (should (equal | ||
| 363 | (diag-region-substring 5 1) | ||
| 364 | "\n")) | ||
| 365 | (should (equal | ||
| 366 | (diag-region-substring 5 nil) | ||
| 367 | "\n"))))) | ||
| 368 | |||
| 369 | |||
| 370 | |||
| 336 | (provide 'flymake-tests) | 371 | (provide 'flymake-tests) |
| 337 | 372 | ||
| 338 | ;;; flymake.el ends here | 373 | ;;; flymake.el ends here |