[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/memrep 01276ea: Add some tests
From: |
Lars Ingebrigtsen |
Subject: |
scratch/memrep 01276ea: Add some tests |
Date: |
Thu, 10 Dec 2020 12:41:38 -0500 (EST) |
branch: scratch/memrep
commit 01276eafca6b4b724b8eb54c5f359e2cf9bee0d8
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Add some tests
---
test/src/fns-tests.el | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el
index 86b8d65..14c0437 100644
--- a/test/src/fns-tests.el
+++ b/test/src/fns-tests.el
@@ -983,3 +983,19 @@
(should (equal (string-search (string-to-multibyte "o\303\270")
"foo\303\270")
2))
(should (equal (string-search "\303\270" "foo\303\270") 3)))
+
+(ert-deftest object-intervals ()
+ (should (equal (object-intervals (propertize "foo" 'bar 'zot))
+ ((0 3 (bar zot)))))
+ (should (equal (object-intervals (concat (propertize "foo" 'bar 'zot)
+ (propertize "foo" 'gazonk
"gazonk")))
+ ((0 3 (bar zot)) (3 6 (gazonk "gazonk")))))
+ (should (equal
+ (with-temp-buffer
+ (insert "foobar")
+ (put-text-property 1 3 'foo 1)
+ (put-text-property 3 6 'bar 2)
+ (put-text-property 2 5 'zot 3)
+ (object-intervals (current-buffer)))
+ ((0 1 (foo 1)) (1 2 (zot 3 foo 1)) (2 4 (zot 3 bar 2))
+ (4 5 (bar 2)) (5 6 nil)))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- scratch/memrep 01276ea: Add some tests,
Lars Ingebrigtsen <=