diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-09-27 14:33:15 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-09-27 14:58:55 +0300 |
commit | 784cb941000f13799545e1bb257c899c7da20064 (patch) | |
tree | 544512af54e18c0e0fdb8c7a0b011644f93e9539 /tests/Makefile.am | |
parent | 1e658c33ad766e23dffff9125aacef8baebdc30a (diff) | |
download | grecs-784cb941000f13799545e1bb257c899c7da20064.tar.gz grecs-784cb941000f13799545e1bb257c899c7da20064.tar.bz2 |
Fix matches in subtrees.
This commit makes it possible to run wildcard matches in
subtrees, e.g. like this:
grecs_match_first(grecs_find_node(tree, root_path), path, &match_buf);
Another effect is that it is possible to use grecs_match_next after
a successful recursion using the grecs_node_exact_match. In other words,
grecs_match_next works well for both exact and wildcard matches, whatever
was the originating node in the tree. (This is used in eclat.)
* src/grecs.h (grecs_match_buf_get_root): New proto.
(grecs_match_buf_set_root): New proto.
* src/lookup.c (grecs_match_buf) <root>: New member.
(grecs_match_buf_get_root)
(grecs_match_buf_set_root): New functions.
(grecs_match): Use root member of struct grecs_match_buf
to determine whether we hit root.
(grecs_match_buf_first): Initialize root.
* src/tree.c (grecs_tree_first_node): Allow for non-root
node as argument (no-op in this case).
* tests/glob04.at: new testcase.
* tests/glob05.at: new testcase.
* tests/Makefile.am: Add new files.
* tests/testsuite.at: Include new files.
* tests/gcfpeek.c: New option "-root", for testing
matches in subtrees.
Diffstat (limited to 'tests/Makefile.am')
-rw-r--r-- | tests/Makefile.am | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 698591d..78a3119 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -79,6 +79,8 @@ TESTSUITE_AT = \ glob01.at\ glob02.at\ glob03.at\ + glob04.at\ + glob05.at\ grecs00.at\ enum.at\ join.at\ |