1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2024-10-27 20:34:16 +00:00

fix test for 'Next' / 'Previous' not working on Search

This commit is contained in:
gnosygnu 2016-10-12 17:21:11 -04:00
parent 2bbdff3ca6
commit d6e055de30
2 changed files with 3 additions and 7 deletions

View File

@ -23,9 +23,9 @@ import gplx.xowa.addons.wikis.searchs.searchers.*; import gplx.xowa.addons.wikis
public class Srch_html_page_bldr_tst { public class Srch_html_page_bldr_tst {
@Before public void init() {fxt.Clear();} private Srch_html_page_bldr_fxt fxt = new Srch_html_page_bldr_fxt(); @Before public void init() {fxt.Clear();} private Srch_html_page_bldr_fxt fxt = new Srch_html_page_bldr_fxt();
@Test public void Paging() { @Test public void Paging() {
fxt.Test_paging(Bool_.Y, 1, "<a href='/site/en.wikipedia.org/wiki/Special:Search/A%3Ffulltext%3Dy%26xowa_page_index%3D2' title='Next'>Next<img src='file:///mem/xowa/bin/any/xowa/file/app.general/go_fwd.png' width='16' height='16'/></a>"); fxt.Test_paging(Bool_.Y, 1, "<a href='/site/en.wikipedia.org/wiki/Special:Search/A?fulltext=y&xowa_page_index=2' title='Next'>Next<img src='file:///mem/xowa/bin/any/xowa/file/app.general/go_fwd.png' width='16' height='16'/></a>");
fxt.Test_paging(Bool_.N, 1, "<a href='/site/en.wikipedia.org/wiki/Special:Search/A%3Ffulltext%3Dy%26xowa_page_index%3D0' title='Previous'><img src='file:///mem/xowa/bin/any/xowa/file/app.general/go_bwd.png' width='16' height='16'/>Previous</a>"); fxt.Test_paging(Bool_.N, 1, "<a href='/site/en.wikipedia.org/wiki/Special:Search/A?fulltext=y&xowa_page_index=0' title='Previous'><img src='file:///mem/xowa/bin/any/xowa/file/app.general/go_bwd.png' width='16' height='16'/>Previous</a>");
fxt.Test_paging(Bool_.Y, 2, "<a href='/site/en.wikipedia.org/wiki/Special:Search/A%3Ffulltext%3Dy%26xowa_page_index%3D3' title='Next'>Next<img src='file:///mem/xowa/bin/any/xowa/file/app.general/go_fwd.png' width='16' height='16'/></a>"); fxt.Test_paging(Bool_.Y, 2, "<a href='/site/en.wikipedia.org/wiki/Special:Search/A?fulltext=y&xowa_page_index=3' title='Next'>Next<img src='file:///mem/xowa/bin/any/xowa/file/app.general/go_fwd.png' width='16' height='16'/></a>");
fxt.Test_paging(Bool_.N, 0, "&#160;"); fxt.Test_paging(Bool_.N, 0, "&#160;");
} }
@Test public void Rows() { @Test public void Rows() {

View File

@ -57,10 +57,6 @@ public class Xow_url_parser__qarg__tst {
fxt.Test__qargs("?k1=v1"); fxt.Test__qargs("?k1=v1");
fxt.Test__to_str("en.wikipedia.org/wiki/A?k1=v1#anch"); fxt.Test__to_str("en.wikipedia.org/wiki/A?k1=v1#anch");
} }
// DELETED: search should not depend on url-decoded entities; should be "Special:Search/Moon?fulltext=y&xowa_page_index=1" DATE:2016-10-10
// @Test public void Search() {
// fxt.Exec__parse("Special:Search/Moon%3Ffulltext%3Dy%26xowa_page_index%3D1").Test__page("Special:Search/Moon").Test__qargs("?fulltext=y&xowa_page_index=1");
//}
// DELETED: this is wrong as url should not handle html_entities like &#61; instead # should strictly designate anch_href; DATE:2016-10-10 // DELETED: this is wrong as url should not handle html_entities like &#61; instead # should strictly designate anch_href; DATE:2016-10-10
// @Test public void Encoded() { // @Test public void Encoded() {
// fxt.Exec__parse("en.wikipedia.org/wiki/A?action&#61;edit&preload&#61;B").Test__wiki("en.wikipedia.org").Test__page("A").Test__qargs("?action=&#61;edit=&preload=&=").Test__anch("61.3BB"); // NOTE: this is wrong; fix later // fxt.Exec__parse("en.wikipedia.org/wiki/A?action&#61;edit&preload&#61;B").Test__wiki("en.wikipedia.org").Test__page("A").Test__qargs("?action=&#61;edit=&preload=&=").Test__anch("61.3BB"); // NOTE: this is wrong; fix later