summaryrefslogtreecommitdiffstats
path: root/tests/010/tree.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-05-12 06:21:58 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-05-12 06:21:58 -0700
commit722a6ca9a69cdd0a463d48af5380af19fd9779fc (patch)
treea09d91f42a23473111faea7773735bc172c9fb98 /tests/010/tree.tl
parent151e5d5dd38015b1be948477d62bf6e8b908352e (diff)
downloadtxr-722a6ca9a69cdd0a463d48af5380af19fd9779fc.tar.gz
txr-722a6ca9a69cdd0a463d48af5380af19fd9779fc.tar.bz2
txr-722a6ca9a69cdd0a463d48af5380af19fd9779fc.zip
tree: let tree-iter be iterable via generic iteration.
* lib.c (seq_iter_init_with_info): Recognize tree_iter object, and treat using tree iterator function. * tests/010/tree.tl: test case for tree subrange iteration with collect-each. * txr.1: Updated.
Diffstat (limited to 'tests/010/tree.tl')
-rw-r--r--tests/010/tree.tl5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/010/tree.tl b/tests/010/tree.tl
index b41e7973..06d02ce6 100644
--- a/tests/010/tree.tl
+++ b/tests/010/tree.tl
@@ -166,6 +166,11 @@
(copy-search-tree tr) #T((identity < =) 1 2 3)
(make-similar-tree tr) #T((identity < =))))
+(test
+ (collect-each ((el (tree-begin #T(() 1 2 3 4 5) 2 5)))
+ (* 10 el))
+ (20 30 40))
+
(mtest
(uni #T(() "a" "b") #T(() "b" "c")) ("a" "b" "c")
(diff #T(() "a" "b") #T(() "b" "c")) ("a")