aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
Diffstat (limited to 'test/src')
-rw-r--r--test/src/buffer-tests.el11
-rw-r--r--test/src/data-tests.el34
2 files changed, 42 insertions, 3 deletions
diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el
index 5f534ed513a..f4654e90bce 100644
--- a/test/src/buffer-tests.el
+++ b/test/src/buffer-tests.el
@@ -1060,7 +1060,9 @@ should evaporate overlays in both."
1060 (should-length 2 (overlays-in 1 (point-max))) 1060 (should-length 2 (overlays-in 1 (point-max)))
1061 (should-length 1 (overlays-in (point-max) (point-max))) 1061 (should-length 1 (overlays-in (point-max) (point-max)))
1062 (narrow-to-region 1 50) 1062 (narrow-to-region 1 50)
1063 (should-length 1 (overlays-in 1 (point-max))) 1063 ;; We only count empty overlays in narrowed buffers excluding the
1064 ;; real EOB when the region is confined to `point-max'.
1065 (should-length 0 (overlays-in 1 (point-max)))
1064 (should-length 1 (overlays-in (point-max) (point-max)))))) 1066 (should-length 1 (overlays-in (point-max) (point-max))))))
1065 1067
1066 1068
@@ -8375,8 +8377,11 @@ dicta sunt, explicabo. "))
8375 (should (= (length (overlays-in 1 2)) 0)) 8377 (should (= (length (overlays-in 1 2)) 0))
8376 (narrow-to-region 1 2) 8378 (narrow-to-region 1 2)
8377 ;; We've now narrowed, so the zero-length overlay is at the end of 8379 ;; We've now narrowed, so the zero-length overlay is at the end of
8378 ;; the (accessible part of the) buffer. 8380 ;; the (accessible part of the) buffer, but we only count it when
8379 (should (= (length (overlays-in 1 2)) 1)) 8381 ;; the region is confined to `point-max'.
8382 (should (= (length (overlays-in 1 2)) 0))
8383 (should (= (length (overlays-in 2 2)) 1))
8384 (should (= (length (overlays-in (point-max) (point-max))) 1))
8380 (remove-overlays) 8385 (remove-overlays)
8381 (should (= (length (overlays-in (point-min) (point-max))) 0)))) 8386 (should (= (length (overlays-in (point-min) (point-max))) 0))))
8382 8387
diff --git a/test/src/data-tests.el b/test/src/data-tests.el
index 0540a99f4c3..2fc971d0214 100644
--- a/test/src/data-tests.el
+++ b/test/src/data-tests.el
@@ -951,4 +951,38 @@ comparing the subr with a much slower Lisp implementation."
951 (should-error (aset s 3 #x3fff80))) ; new char not ASCII 951 (should-error (aset s 3 #x3fff80))) ; new char not ASCII
952 ) 952 )
953 953
954(ert-deftest data-tests-per-buffer-var-predicates ()
955 (with-temp-buffer
956 ;; per buffer variable without predicate
957 (progn
958 (setq line-spacing 2.3)
959 (should (= line-spacing 2.3))
960 (setq line-spacing "2.3")
961 (should (equal line-spacing "2.3"))
962 (setq line-spacing nil)
963 (should (equal line-spacing nil)))
964 ;; per buffer variable with 'fraction predicate
965 (progn
966 (dolist (v '(nil 0.7))
967 (setq scroll-up-aggressively v)
968 (should (equal scroll-up-aggressively v)))
969 (should-error (setq scroll-up-aggressively 'abc)
970 :type 'wrong-type-argument)
971 (should-error (setq scroll-up-aggressively 2.7))
972 (should (equal scroll-up-aggressively 0.7)))
973 ;; per buffer variable with 'vertical-scroll-bar predicate
974 (progn
975 (dolist (v (get 'vertical-scroll-bar 'choice))
976 (setq vertical-scroll-bar v)
977 (should (equal vertical-scroll-bar v)))
978 (should-error (setq vertical-scroll-bar 'foo))
979 (should (equal vertical-scroll-bar 'right)))
980 ;; per buffer variable with 'overwrite-mode predicate
981 (progn
982 (dolist (v (get 'overwrite-mode 'choice))
983 (setq overwrite-mode v)
984 (should (equal overwrite-mode v)))
985 (should-error (setq overwrite-mode 'foo))
986 (should (equal overwrite-mode 'overwrite-mode-binary)))))
987
954;;; data-tests.el ends here 988;;; data-tests.el ends here