diff --git a/test/src/data-tests.el b/test/src/data-tests.el index fa2b4d7c4e6..7c0796c5d2a 100644 --- a/test/src/data-tests.el +++ b/test/src/data-tests.el @@ -815,6 +815,13 @@ comparing the subr with a much slower Lisp implementation." (should (= (lognot n) (- -1 n))) (should (= (lognot m) (- -1 m))))) +(ert-deftest data-tests-bignum-bit-identities () + (let ((n (1+ most-positive-fixnum))) + (should (bignump n)) + (should (= (logand n (lognot n)) 0)) + (should (= (logior n (lognot n)) -1)) + (should (= (logxor n n) 0)))) + (ert-deftest data-tests-logior () (should (= -1 (logior -1) (logior -1 -1))) (should (= -1 (logior most-positive-fixnum most-negative-fixnum)))) diff --git a/test/src/editfns-tests.el b/test/src/editfns-tests.el index bbe7199bdcd..0f5e0adc419 100644 --- a/test/src/editfns-tests.el +++ b/test/src/editfns-tests.el @@ -1058,6 +1058,33 @@ sufficiently large to avoid truncation." (goto-char (point-max)) (should (= (following-char) 0)))) +(ert-deftest editfns-tests--buffer-substring-properties () + (with-temp-buffer + (insert "abc") + (add-text-properties (point-min) (point-max) '(foo bar)) + (let ((with-props (buffer-substring (point-min) (point-max))) + (without-props (buffer-substring-no-properties + (point-min) (point-max)))) + (should (equal with-props "abc")) + (should (equal without-props "abc")) + (should (eq (get-text-property 0 'foo with-props) 'bar)) + (should-not (get-text-property 0 'foo without-props))))) + +(ert-deftest editfns-tests--insert-and-inherit () + (with-temp-buffer + (insert "a") + (add-text-properties 1 2 '(foo bar)) + (goto-char (point-max)) + (insert "b") + (should-not (get-text-property 2 'foo)) + (erase-buffer)) + (with-temp-buffer + (insert "a") + (add-text-properties 1 2 '(foo bar)) + (goto-char (point-max)) + (insert-and-inherit "b") + (should (eq (get-text-property 2 'foo) 'bar)))) + (ert-deftest editfns-tests--line-beginning-end-position () (with-temp-buffer (insert "aa\nbb\ncc") diff --git a/test/src/eval-tests.el b/test/src/eval-tests.el index 1e7c33069a7..686508a6a8d 100644 --- a/test/src/eval-tests.el +++ b/test/src/eval-tests.el @@ -374,6 +374,22 @@ expressions works for identifiers starting with period." (error err)))) (should (eq inner-error outer-error)))) +(ert-deftest eval-tests--condition-case-basic () + (should (equal (condition-case err + 42 + (error (list 'err err))) + 42)) + (should (equal (condition-case err + (signal 'wrong-type-argument '(integerp "x")) + (wrong-type-argument (list 'wt err)) + (error (list 'err err))) + '(wt (wrong-type-argument integerp "x")))) + (should (equal (condition-case err + (signal 'error '("boom")) + (wrong-type-argument (list 'wt err)) + (error (list 'err err))) + '(err (error "boom"))))) + (ert-deftest eval-bad-specbind () (should-error (eval '(let (((a b) 23)) (+ 1 2)) t) :type 'wrong-type-argument) diff --git a/test/src/marker-tests.el b/test/src/marker-tests.el index 19ecca2d0af..4311a82693b 100644 --- a/test/src/marker-tests.el +++ b/test/src/marker-tests.el @@ -124,4 +124,22 @@ (should (= (marker-position maxm) 3)) (should (eq (marker-buffer minm) (current-buffer)))))) +(ert-deftest marker-tests--move-marker-between-buffers () + (let ((buf-1 (generate-new-buffer " *marker-tests-1*")) + (buf-2 (generate-new-buffer " *marker-tests-2*"))) + (unwind-protect + (let ((m (make-marker))) + (with-current-buffer buf-1 + (insert "abc") + (set-marker m 2 (current-buffer))) + (should (eq (marker-buffer m) buf-1)) + (should (= (marker-position m) 2)) + (with-current-buffer buf-2 + (insert "xyz") + (set-marker m 1 (current-buffer))) + (should (eq (marker-buffer m) buf-2)) + (should (= (marker-position m) 1))) + (kill-buffer buf-1) + (kill-buffer buf-2)))) + ;;; marker-tests.el ends here