aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNicolas Petton2015-09-06 00:51:35 +0200
committerNicolas Petton2015-09-06 00:51:35 +0200
commit1b5fda5cbca96aec3e407bc9e4f8a16e48e7954c (patch)
treed85433211e2e19cf00ea34a4b06db3ef1e4c49e6 /test
parenta1535f938181ea137037d0233924a2c9d9e08f76 (diff)
downloademacs-1b5fda5cbca96aec3e407bc9e4f8a16e48e7954c.tar.gz
emacs-1b5fda5cbca96aec3e407bc9e4f8a16e48e7954c.zip
Improve the semantic of map-some
Update map-some to return the returned by the predicate, similar to seq-some. * lisp/emacs-lisp/map.el (map-some): Update the function to return the return value of the predicate. * test/automated/map-tests.el (test-map-some): Update the test to check for non-nil values only.
Diffstat (limited to 'test')
-rw-r--r--test/automated/map-tests.el26
1 files changed, 12 insertions, 14 deletions
diff --git a/test/automated/map-tests.el b/test/automated/map-tests.el
index ca680041944..8693415a784 100644
--- a/test/automated/map-tests.el
+++ b/test/automated/map-tests.el
@@ -262,21 +262,19 @@ Evaluate BODY for each created map.
262 262
263(ert-deftest test-map-some () 263(ert-deftest test-map-some ()
264 (with-maps-do map 264 (with-maps-do map
265 (should (equal (map-some (lambda (k _v) 265 (should (map-some (lambda (k _v)
266 (eq 1 k)) 266 (eq 1 k))
267 map) 267 map))
268 (cons 1 4))) 268 (should-not (map-some (lambda (k _v)
269 (should (not (map-some (lambda (k _v) 269 (eq 'd k))
270 (eq 'd k)) 270 map)))
271 map))))
272 (let ((vec [a b c])) 271 (let ((vec [a b c]))
273 (should (equal (map-some (lambda (k _v) 272 (should (map-some (lambda (k _v)
274 (> k 1)) 273 (> k 1))
275 vec) 274 vec))
276 (cons 2 'c))) 275 (should-not (map-some (lambda (k _v)
277 (should (not (map-some (lambda (k _v) 276 (> k 3))
278 (> k 3)) 277 vec))))
279 vec)))))
280 278
281(ert-deftest test-map-every-p () 279(ert-deftest test-map-every-p ()
282 (with-maps-do map 280 (with-maps-do map