Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check search limit depth with an inequality #154

Merged
merged 2 commits into from Jan 20, 2013
Merged

Check search limit depth with an inequality #154

merged 2 commits into from Jan 20, 2013

Conversation

gturri
Copy link
Contributor

@gturri gturri commented Jan 10, 2013

Otherwise, when we check for equality, the test fails if the search starts beneath
the max depth.
Eg: if I have the page ns1:ns2:mypage in my wiki, and launch the xmlrpc query
getPagelist("ns1", "depth => 1"), without this patch, it retrieves mypage

The following test (made with the xml-rpc client dokuJClient) fails without this patch, but succeeds with it:

@org.junit.Test
public void testGetPagelistWithAMaxDepth() throws Exception {
    //Setting up test environmnent
    DokuJClient client = new DokuJClient(TestParams.url, TestParams.user, TestParams.password);
    client.putPage("ns:shallow_page", "some text");
    client.putPage("ns:subns:deep_page", "some text");

    Map<String, Object> options = new HashMap<String, Object>();
    options.put("depth", 1);

    //Testing
    List<PageDW> pages = client.getPagelist("ns", options);
    assertEquals(1, pages.size());
    assertEquals("ns:shallow_page", pages.get(0).id());

    pages = client.getPagelist("ns:subns", options);
    assertEquals(0, pages.size());
}

Otherwise, when we check for equality, the test fails if the search start beneath
the max depth.
Eg: if I have the page ns1:ns2:mypage in my wiki, and launch the xmlrpc query
getPagelist("ns1", "depth => 1"), without this patch, it retrieves mypage
At least if we want to be consistent with search_universal
splitbrain added a commit that referenced this pull request Jan 20, 2013
Check search limit depth with an inequality
@splitbrain splitbrain merged commit ad4665d into dokuwiki:master Jan 20, 2013
@splitbrain
Copy link
Collaborator

Merged. It would be cool if you could provide some unit tests for the search function(s) in our own test suite.

@gturri gturri mentioned this pull request Jan 21, 2013
michitux added a commit that referenced this pull request Feb 20, 2013
This reverts parts of the changes from #154: Before merging the pull
request, a depth of 1 returned just the pages in the root namespace.
With the changes in the pull request, a depth of 1 also returned pages
in subnamespaces of the root namespace (as it was also tested in the test case).
This reverts this part of the changes and a depth of 1 returns just the
pages in the root namespace again.
michitux added a commit that referenced this pull request Feb 24, 2013
This reverts parts of the changes from #154: Before merging the pull
request, a depth of 1 returned just the pages in the root namespace.
With the changes in the pull request, a depth of 1 also returned pages
in subnamespaces of the root namespace (as it was also tested in the test case).
This reverts this part of the changes and a depth of 1 returns just the
pages in the root namespace again.
splitbrain pushed a commit that referenced this pull request Apr 9, 2020
Add helper-API for export/import
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants