splitbrain/dokuwiki — pull request #154 by gturri (2013-01-10 07:25:50+00:00)
Title: Check search limit depth with an inequality

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](https://github.com/gturri/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 options = new HashMap();
options.put("depth", 1);

//Testing
List 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());
}