diff options
author | Sean Allred <code@seanallred.com> | 2015-01-04 11:41:30 -0500 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2015-01-04 11:57:52 -0500 |
commit | 59327f6f9c6ba419543c47670a62af0aa41271ca (patch) | |
tree | 4c5dcd1ab569769f3ad338976abb601cf787c2db /test/test-util.el | |
parent | 0e03d9086eedd486a4492e5f198e45990ad5a3bf (diff) |
Tree-style specification for filter-from-nil
Instead of saying
(field-a
field-b
object-a.subfield
field-c
object-b.subfield-a object-b.subfield-b)
you can rather say
(field-a
field-b
(object-a subfield)
field-c
(object-b subfield-a subfield-b))
To avoid a dependency loop, sx-browse-filter has been moved to
sx-filter.el.
Diffstat (limited to 'test/test-util.el')
-rw-r--r-- | test/test-util.el | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test-util.el b/test/test-util.el index 5db1691..1e3dc2b 100644 --- a/test/test-util.el +++ b/test/test-util.el @@ -29,3 +29,17 @@ (string= (sx--thing-as-string 'test& nil t) "test%26"))) + +(ert-deftest tree () + (should + (equal + (sx--tree-expand + (lambda (path) (mapconcat #'symbol-name path ".")) + '(a b (c d (e f g) h i (j k) l) m (n o) p)) + '("a" "b" "c.d" "c.e.f" "c.e.g" "c.h" "c.i" "c.j.k" "c.l" "m" "n.o" "p"))) + (should + (equal + (sx--tree-expand + (lambda (path) (intern (mapconcat #'symbol-name path "/"))) + '(a b (c d (e f g) h i (j k) l) m (n o) p)) + '(a b c/d c/e/f c/e/g c/h c/i c/j/k c/l m n/o p)))) |