aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorStefan Kangas2023-01-23 01:34:43 +0100
committerStefan Kangas2023-01-23 01:34:43 +0100
commit080595682f73a920b9c9bf3eba10548ccc652e79 (patch)
treeb234331cde5d788bf1b9022392332c5fdc5ebcc0 /test
parent1c58f3d7fb298f9ee6aa8554d6537d13cb1944a5 (diff)
parentb875c9bf67ebf858648a00307c370d7a196aab56 (diff)
downloademacs-080595682f73a920b9c9bf3eba10548ccc652e79.tar.gz
emacs-080595682f73a920b9c9bf3eba10548ccc652e79.zip
Merge from origin/emacs-29
b875c9bf67e Fix file-regular-p in Tramp 63fa225d443 Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/... 9f5d6c541e5 ; * doc/emacs/custom.texi (Init Rebinding): Fix wording i... a91b435d0d5 ; Reword user documentation on binding keys in Lisp 0400de6a7de Fix typo in c-ts-mode (bug#60932)
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/tramp-archive-tests.el3
-rw-r--r--test/lisp/net/tramp-tests.el22
2 files changed, 24 insertions, 1 deletions
diff --git a/test/lisp/net/tramp-archive-tests.el b/test/lisp/net/tramp-archive-tests.el
index 8fe1dbd8d0b..94ef40a1116 100644
--- a/test/lisp/net/tramp-archive-tests.el
+++ b/test/lisp/net/tramp-archive-tests.el
@@ -685,6 +685,7 @@ This tests also `access-file', `file-readable-p' and `file-regular-p'."
685 ;; Symlink. 685 ;; Symlink.
686 (should (file-exists-p tmp-name2)) 686 (should (file-exists-p tmp-name2))
687 (should (file-symlink-p tmp-name2)) 687 (should (file-symlink-p tmp-name2))
688 (should (file-regular-p tmp-name2))
688 (setq attr (file-attributes tmp-name2)) 689 (setq attr (file-attributes tmp-name2))
689 (should (string-equal (car attr) (file-name-nondirectory tmp-name1))) 690 (should (string-equal (car attr) (file-name-nondirectory tmp-name1)))
690 691
@@ -775,12 +776,14 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
775 (unwind-protect 776 (unwind-protect
776 (progn 777 (progn
777 (should (file-exists-p tmp-name1)) 778 (should (file-exists-p tmp-name1))
779 (should (file-regular-p tmp-name1))
778 (should (string-equal tmp-name1 (file-truename tmp-name1))) 780 (should (string-equal tmp-name1 (file-truename tmp-name1)))
779 ;; `make-symbolic-link' is not implemented. 781 ;; `make-symbolic-link' is not implemented.
780 (should-error 782 (should-error
781 (make-symbolic-link tmp-name1 tmp-name2) 783 (make-symbolic-link tmp-name1 tmp-name2)
782 :type 'file-error) 784 :type 'file-error)
783 (should (file-symlink-p tmp-name2)) 785 (should (file-symlink-p tmp-name2))
786 (should (file-regular-p tmp-name2))
784 (should 787 (should
785 (string-equal 788 (string-equal
786 ;; This is "/foo.txt". 789 ;; This is "/foo.txt".
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 0932a53f4b1..60545e7270f 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -3513,6 +3513,9 @@ This tests also `access-file', `file-readable-p',
3513 (access-file tmp-name1 "error") 3513 (access-file tmp-name1 "error")
3514 :type 'file-missing) 3514 :type 'file-missing)
3515 3515
3516 (should-not (file-exists-p tmp-name1))
3517 (should-not (file-readable-p tmp-name1))
3518 (should-not (file-regular-p tmp-name1))
3516 ;; `file-ownership-preserved-p' should return t for 3519 ;; `file-ownership-preserved-p' should return t for
3517 ;; non-existing files. 3520 ;; non-existing files.
3518 (when test-file-ownership-preserved-p 3521 (when test-file-ownership-preserved-p
@@ -3597,7 +3600,7 @@ This tests also `access-file', `file-readable-p',
3597 (should (file-exists-p tmp-name1)) 3600 (should (file-exists-p tmp-name1))
3598 (should (file-readable-p tmp-name1)) 3601 (should (file-readable-p tmp-name1))
3599 (should-not (file-regular-p tmp-name1)) 3602 (should-not (file-regular-p tmp-name1))
3600 (should-not (access-file tmp-name1 "")) 3603 (should-not (access-file tmp-name1 "error"))
3601 (when test-file-ownership-preserved-p 3604 (when test-file-ownership-preserved-p
3602 (should (file-ownership-preserved-p tmp-name1 'group))) 3605 (should (file-ownership-preserved-p tmp-name1 'group)))
3603 (setq attr (file-attributes tmp-name1)) 3606 (setq attr (file-attributes tmp-name1))
@@ -3936,7 +3939,10 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
3936 (tramp--test-ignore-make-symbolic-link-error 3939 (tramp--test-ignore-make-symbolic-link-error
3937 (write-region "foo" nil tmp-name1) 3940 (write-region "foo" nil tmp-name1)
3938 (should (file-exists-p tmp-name1)) 3941 (should (file-exists-p tmp-name1))
3942 (should (file-regular-p tmp-name1))
3939 (make-symbolic-link tmp-name1 tmp-name2) 3943 (make-symbolic-link tmp-name1 tmp-name2)
3944 (should (file-exists-p tmp-name2))
3945 (should (file-regular-p tmp-name2))
3940 (should 3946 (should
3941 (string-equal 3947 (string-equal
3942 (funcall 3948 (funcall
@@ -3987,6 +3993,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
3987 (string-equal tmp-name1 (file-symlink-p tmp-name3)))) 3993 (string-equal tmp-name1 (file-symlink-p tmp-name3))))
3988 ;; Check directory as newname. 3994 ;; Check directory as newname.
3989 (make-directory tmp-name4) 3995 (make-directory tmp-name4)
3996 (should (file-directory-p tmp-name4))
3997 (should-not (file-regular-p tmp-name4))
3990 (when (tramp--test-expensive-test-p) 3998 (when (tramp--test-expensive-test-p)
3991 (should-error 3999 (should-error
3992 (make-symbolic-link tmp-name1 tmp-name4) 4000 (make-symbolic-link tmp-name1 tmp-name4)
@@ -4000,6 +4008,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4000 (file-symlink-p tmp-name5))) 4008 (file-symlink-p tmp-name5)))
4001 ;; Check, that files in symlinked directories still work. 4009 ;; Check, that files in symlinked directories still work.
4002 (make-symbolic-link tmp-name4 tmp-name6) 4010 (make-symbolic-link tmp-name4 tmp-name6)
4011 (should (file-symlink-p tmp-name6))
4012 (should-not (file-regular-p tmp-name6))
4003 (write-region "foo" nil (expand-file-name "foo" tmp-name6)) 4013 (write-region "foo" nil (expand-file-name "foo" tmp-name6))
4004 (delete-file (expand-file-name "foo" tmp-name6)) 4014 (delete-file (expand-file-name "foo" tmp-name6))
4005 (should-not (file-exists-p (expand-file-name "foo" tmp-name4))) 4015 (should-not (file-exists-p (expand-file-name "foo" tmp-name4)))
@@ -4061,9 +4071,11 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4061 (tramp--test-ignore-make-symbolic-link-error 4071 (tramp--test-ignore-make-symbolic-link-error
4062 (write-region "foo" nil tmp-name1) 4072 (write-region "foo" nil tmp-name1)
4063 (should (file-exists-p tmp-name1)) 4073 (should (file-exists-p tmp-name1))
4074 (should (file-regular-p tmp-name1))
4064 (should (string-equal tmp-name1 (file-truename tmp-name1))) 4075 (should (string-equal tmp-name1 (file-truename tmp-name1)))
4065 (make-symbolic-link tmp-name1 tmp-name2) 4076 (make-symbolic-link tmp-name1 tmp-name2)
4066 (should (file-symlink-p tmp-name2)) 4077 (should (file-symlink-p tmp-name2))
4078 (should (file-regular-p tmp-name2))
4067 (should-not (string-equal tmp-name2 (file-truename tmp-name2))) 4079 (should-not (string-equal tmp-name2 (file-truename tmp-name2)))
4068 (should 4080 (should
4069 (string-equal (file-truename tmp-name1) (file-truename tmp-name2))) 4081 (string-equal (file-truename tmp-name1) (file-truename tmp-name2)))
@@ -4073,6 +4085,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4073 (let ((default-directory ert-remote-temporary-file-directory)) 4085 (let ((default-directory ert-remote-temporary-file-directory))
4074 (make-symbolic-link (file-name-nondirectory tmp-name1) tmp-name2)) 4086 (make-symbolic-link (file-name-nondirectory tmp-name1) tmp-name2))
4075 (should (file-symlink-p tmp-name2)) 4087 (should (file-symlink-p tmp-name2))
4088 (should (file-regular-p tmp-name2))
4076 (should-not (string-equal tmp-name2 (file-truename tmp-name2))) 4089 (should-not (string-equal tmp-name2 (file-truename tmp-name2)))
4077 (should 4090 (should
4078 (string-equal (file-truename tmp-name1) (file-truename tmp-name2))) 4091 (string-equal (file-truename tmp-name1) (file-truename tmp-name2)))
@@ -4087,6 +4100,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4087 (funcall (if quoted #'file-name-unquote #'identity) penguin) 4100 (funcall (if quoted #'file-name-unquote #'identity) penguin)
4088 tmp-name2) 4101 tmp-name2)
4089 (should (file-symlink-p tmp-name2)) 4102 (should (file-symlink-p tmp-name2))
4103 (should-not (file-regular-p tmp-name2))
4090 (should 4104 (should
4091 (string-equal 4105 (string-equal
4092 (file-truename tmp-name2) 4106 (file-truename tmp-name2)
@@ -4096,6 +4110,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4096 (unless (tramp--test-windows-nt-p) 4110 (unless (tramp--test-windows-nt-p)
4097 (make-symbolic-link tmp-name1 tmp-name3) 4111 (make-symbolic-link tmp-name1 tmp-name3)
4098 (should (file-symlink-p tmp-name3)) 4112 (should (file-symlink-p tmp-name3))
4113 (should-not (file-regular-p tmp-name3))
4099 (should-not (string-equal tmp-name3 (file-truename tmp-name3))) 4114 (should-not (string-equal tmp-name3 (file-truename tmp-name3)))
4100 ;; `file-truename' returns a quoted file name for `tmp-name3'. 4115 ;; `file-truename' returns a quoted file name for `tmp-name3'.
4101 ;; We must unquote it. 4116 ;; We must unquote it.
@@ -4124,6 +4139,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4124 (make-symbolic-link 4139 (make-symbolic-link
4125 tmp-name3 4140 tmp-name3
4126 (setq tmp-name3 (tramp--test-make-temp-name nil quoted)))) 4141 (setq tmp-name3 (tramp--test-make-temp-name nil quoted))))
4142 (should-not (file-regular-p tmp-name2))
4143 (should-not (file-regular-p tmp-name3))
4127 (should 4144 (should
4128 (string-equal 4145 (string-equal
4129 (file-truename tmp-name2) 4146 (file-truename tmp-name2)
@@ -4154,6 +4171,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4154 (tramp--test-ignore-make-symbolic-link-error 4171 (tramp--test-ignore-make-symbolic-link-error
4155 (make-symbolic-link tmp-name2 tmp-name1) 4172 (make-symbolic-link tmp-name2 tmp-name1)
4156 (should (file-symlink-p tmp-name1)) 4173 (should (file-symlink-p tmp-name1))
4174 (should-not (file-regular-p tmp-name1))
4175 (should-not (file-regular-p tmp-name2))
4157 (if (tramp--test-smb-p) 4176 (if (tramp--test-smb-p)
4158 ;; The symlink command of "smbclient" detects the 4177 ;; The symlink command of "smbclient" detects the
4159 ;; cycle already. 4178 ;; cycle already.
@@ -4162,6 +4181,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4162 :type 'file-error) 4181 :type 'file-error)
4163 (make-symbolic-link tmp-name1 tmp-name2) 4182 (make-symbolic-link tmp-name1 tmp-name2)
4164 (should (file-symlink-p tmp-name2)) 4183 (should (file-symlink-p tmp-name2))
4184 (should-not (file-regular-p tmp-name2))
4165 (should-error 4185 (should-error
4166 (file-truename tmp-name1) 4186 (file-truename tmp-name1)
4167 :type 'file-error)))) 4187 :type 'file-error))))