summaryrefslogtreecommitdiff
path: root/test/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp')
-rw-r--r--test/lisp/custom-tests.el38
-rw-r--r--test/lisp/net/tramp-tests.el4
2 files changed, 41 insertions, 1 deletions
diff --git a/test/lisp/custom-tests.el b/test/lisp/custom-tests.el
index 7691f167738..232e3bed439 100644
--- a/test/lisp/custom-tests.el
+++ b/test/lisp/custom-tests.el
@@ -165,4 +165,42 @@
(enable-theme 'custom--test)
(should (equal settings (get 'custom--test 'theme-settings)))))
+(defcustom custom--test-local-option 'initial
+ "Buffer-local user option for testing."
+ :group 'emacs
+ :type '(choice (const initial) (const changed))
+ :local t)
+
+(defcustom custom--test-permanent-option 'initial
+ "Permanently local user option for testing."
+ :group 'emacs
+ :type '(choice (const initial) (const changed))
+ :local 'permanent)
+
+(ert-deftest custom-test-local-option ()
+ "Test :local user options."
+ ;; Initial default values.
+ (should (eq custom--test-local-option 'initial))
+ (should (eq custom--test-permanent-option 'initial))
+ (should (eq (default-value 'custom--test-local-option) 'initial))
+ (should (eq (default-value 'custom--test-permanent-option) 'initial))
+ (let ((obuf (current-buffer)))
+ (with-temp-buffer
+ ;; Changed buffer-local values.
+ (setq custom--test-local-option 'changed)
+ (setq custom--test-permanent-option 'changed)
+ (should (eq custom--test-local-option 'changed))
+ (should (eq custom--test-permanent-option 'changed))
+ (should (eq (default-value 'custom--test-local-option) 'initial))
+ (should (eq (default-value 'custom--test-permanent-option) 'initial))
+ (with-current-buffer obuf
+ (should (eq custom--test-local-option 'initial))
+ (should (eq custom--test-permanent-option 'initial)))
+ ;; Permanent variable remains unchanged.
+ (kill-all-local-variables)
+ (should (eq custom--test-local-option 'initial))
+ (should (eq custom--test-permanent-option 'changed))
+ (should (eq (default-value 'custom--test-local-option) 'initial))
+ (should (eq (default-value 'custom--test-permanent-option) 'initial)))))
+
;;; custom-tests.el ends here
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 00d08ea6f67..b2e8cc19459 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -4466,7 +4466,9 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(setq proc (start-file-process "test4" (current-buffer) nil))
(should (processp proc))
(should (equal (process-status proc) 'run))
- (should (stringp (process-tty-name proc)))))
+ ;; On MS Windows, `process-tty-name' returns nil.
+ (unless (tramp--test-windows-nt)
+ (should (stringp (process-tty-name proc))))))
;; Cleanup.
(ignore-errors (delete-process proc))))))