diff options
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)))) |