[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/compat dab2ec091d 01/16: Restore tests
From: |
ELPA Syncer |
Subject: |
[elpa] externals/compat dab2ec091d 01/16: Restore tests |
Date: |
Wed, 4 Jan 2023 07:57:26 -0500 (EST) |
branch: externals/compat
commit dab2ec091d51bb0220453f1a3d28664f4d3ccd92
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Restore tests
---
compat-tests.el | 119 +++++++++++++++++++-------------------------------------
1 file changed, 41 insertions(+), 78 deletions(-)
diff --git a/compat-tests.el b/compat-tests.el
index aaa36bb825..4bf187dad1 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -32,6 +32,7 @@
(require 'ert)
(require 'compat)
(require 'subr-x)
+(require 'text-property-search nil t)
(setq ert-quiet t)
(ert-deftest compat-call ()
@@ -249,6 +250,46 @@
(json-insert '((:key . ["abc" 2]) (yek . t)))
(should (equal (buffer-string) "{\":key\":[\"abc\",2],\"yek\":true}"))))
+(ert-deftest compat-text-property-search-forward ()
+ (with-temp-buffer
+ (insert "one "
+ (propertize "two " 'prop 'val)
+ "three "
+ (propertize "four " 'prop 'wert)
+ "five ")
+ (goto-char (point-min))
+ (let ((match (text-property-search-forward 'prop)))
+ (should (eq (prop-match-beginning match) 5))
+ (should (eq (prop-match-end match) 9))
+ (should (eq (prop-match-value match) 'val)))
+ (let ((match (text-property-search-forward 'prop)))
+ (should (eq (prop-match-beginning match) 15))
+ (should (eq (prop-match-end match) 20))
+ (should (eq (prop-match-value match) 'wert)))
+ (should (null (text-property-search-forward 'prop)))
+ (goto-char (point-min))
+ (should (null (text-property-search-forward 'non-existant)))))
+
+(ert-deftest compat-text-property-search-backward ()
+ (with-temp-buffer
+ (insert "one "
+ (propertize "two " 'prop 'val)
+ "three "
+ (propertize "four " 'prop 'wert)
+ "five ")
+ (goto-char (point-max))
+ (let ((match (text-property-search-backward 'prop)))
+ (should (eq (prop-match-beginning match) 15))
+ (should (eq (prop-match-end match) 20))
+ (should (eq (prop-match-value match) 'wert)))
+ (let ((match (text-property-search-backward 'prop)))
+ (should (eq (prop-match-beginning match) 5))
+ (should (eq (prop-match-end match) 9))
+ (should (eq (prop-match-value match) 'val)))
+ (should (null (text-property-search-backward 'prop)))
+ (goto-char (point-max))
+ (should (null (text-property-search-backward 'non-existant)))))
+
;; (defun compat--expect (name compat)
;; "Implementation for the `expect' macro for NAME.
;; COMPAT is the name of the compatibility function the behaviour is
@@ -1771,83 +1812,5 @@
;; #'compat--make-prop-match-with-vector
;; #'compat--make-prop-match-with-record)))
-;; (ert-deftest compat-text-property-search-forward ()
-;; (when (fboundp 'text-property-search-forward)
-;; (with-temp-buffer
-;; (insert "one "
-;; (propertize "two " 'prop 'val)
-;; "three "
-;; (propertize "four " 'prop 'wert)
-;; "five ")
-;; (goto-char (point-min))
-;; (let ((match (text-property-search-forward 'prop)))
-;; (should (eq (prop-match-beginning match) 5))
-;; (should (eq (prop-match-end match) 9))
-;; (should (eq (prop-match-value match) 'val)))
-;; (let ((match (text-property-search-forward 'prop)))
-;; (should (eq (prop-match-beginning match) 15))
-;; (should (eq (prop-match-end match) 20))
-;; (should (eq (prop-match-value match) 'wert)))
-;; (should (null (text-property-search-forward 'prop)))
-;; (goto-char (point-min))
-;; (should (null (text-property-search-forward 'non-existant)))))
-;; (with-temp-buffer
-;; (insert "one "
-;; (propertize "two " 'prop 'val)
-;; "three "
-;; (propertize "four " 'prop 'wert)
-;; "five ")
-;; (goto-char (point-min))
-;; (let ((match (compat--t-text-property-search-forward 'prop)))
-;; (should (eq (compat--t-prop-match-beginning match) 5))
-;; (should (eq (compat--t-prop-match-end match) 9))
-;; (should (eq (compat--t-prop-match-value match) 'val)))
-;; (let ((match (compat--t-text-property-search-forward 'prop)))
-;; (should (eq (compat--t-prop-match-beginning match) 15))
-;; (should (eq (compat--t-prop-match-end match) 20))
-;; (should (eq (compat--t-prop-match-value match) 'wert)))
-;; (should (null (compat--t-text-property-search-forward 'prop)))
-;; (goto-char (point-min))
-;; (should (null (compat--t-text-property-search-forward 'non-existant)))))
-
-;; (ert-deftest compat-text-property-search-backward ()
-;; (when (fboundp 'text-property-search-backward)
-;; (with-temp-buffer
-;; (insert "one "
-;; (propertize "two " 'prop 'val)
-;; "three "
-;; (propertize "four " 'prop 'wert)
-;; "five ")
-;; (goto-char (point-max))
-;; (let ((match (text-property-search-backward 'prop)))
-;; (should (eq (prop-match-beginning match) 15))
-;; (should (eq (prop-match-end match) 20))
-;; (should (eq (prop-match-value match) 'wert)))
-;; (let ((match (text-property-search-backward 'prop)))
-;; (should (eq (prop-match-beginning match) 5))
-;; (should (eq (prop-match-end match) 9))
-;; (should (eq (prop-match-value match) 'val)))
-;; (should (null (text-property-search-backward 'prop)))
-;; (goto-char (point-max))
-;; (should (null (text-property-search-backward 'non-existant)))))
-;; (with-temp-buffer
-;; (insert "one "
-;; (propertize "two " 'prop 'val)
-;; "three "
-;; (propertize "four " 'prop 'wert)
-;; "five ")
-;; (goto-char (point-max))
-;; (let ((match (compat--t-text-property-search-backward 'prop)))
-;; (should (eq (compat--t-prop-match-beginning match) 15))
-;; (should (eq (compat--t-prop-match-end match) 20))
-;; (should (eq (compat--t-prop-match-value match) 'wert)))
-;; (let ((match (compat--t-text-property-search-backward 'prop)))
-;; (should (eq (compat--t-prop-match-beginning match) 5))
-;; (should (eq (compat--t-prop-match-end match) 9))
-;; (should (eq (compat--t-prop-match-value match) 'val)))
-;; (should (null (compat--t-text-property-search-backward 'prop)))
-;; (goto-char (point-max))
-;; (should (null (compat--t-text-property-search-backward
'non-existant)))))
-
(provide 'compat-tests)
;;; compat-tests.el ends here
- [elpa] externals/compat updated (3ee973db10 -> 0bb4709d83), ELPA Syncer, 2023/01/04
- [elpa] externals/compat 601387077a 04/16: Always require subr-x at compile time, ELPA Syncer, 2023/01/04
- [elpa] externals/compat 9ecaf46e15 09/16: Restore explicit versions of string-trim, ELPA Syncer, 2023/01/04
- [elpa] externals/compat dab2ec091d 01/16: Restore tests,
ELPA Syncer <=
- [elpa] externals/compat de7346396a 05/16: Add compat-feature macro, ELPA Syncer, 2023/01/04
- [elpa] externals/compat d18955c1be 07/16: Remove comments, ELPA Syncer, 2023/01/04
- [elpa] externals/compat 8ebf7984ce 06/16: Revert "Add compat-feature macro", ELPA Syncer, 2023/01/04
- [elpa] externals/compat 7737bb9d56 08/16: Run all checks at compile time, ELPA Syncer, 2023/01/04
- [elpa] externals/compat 31810cd4d9 10/16: Add :feature, ELPA Syncer, 2023/01/04
- [elpa] externals/compat e8de246d40 14/16: Update manual, ELPA Syncer, 2023/01/04
- [elpa] externals/compat 71f9648cdf 03/16: Specify features, ELPA Syncer, 2023/01/04
- [elpa] externals/compat 7aa705b65e 02/16: Require features at compile time, ELPA Syncer, 2023/01/04
- [elpa] externals/compat ce86316661 11/16: Restore tests, ELPA Syncer, 2023/01/04
- [elpa] externals/compat f342b01a10 12/16: Update manual, ELPA Syncer, 2023/01/04