mirror of
https://github.com/apache/lucene.git
synced 2025-03-01 22:09:24 +00:00
SOLR-4524: test proving this works
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1452612 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
be7f8b5144
commit
7347761737
@ -49,7 +49,7 @@ public class ReturnFieldsTest extends SolrTestCaseJ4 {
|
|||||||
public static void beforeClass() throws Exception {
|
public static void beforeClass() throws Exception {
|
||||||
initCore("solrconfig.xml", "schema12.xml");
|
initCore("solrconfig.xml", "schema12.xml");
|
||||||
String v = "how now brown cow";
|
String v = "how now brown cow";
|
||||||
assertU(adoc("id","1", "text",v, "text_np", v));
|
assertU(adoc("id","1", "text",v, "text_np", v, "#foo_s", v));
|
||||||
v = "now cow";
|
v = "now cow";
|
||||||
assertU(adoc("id","2", "text",v, "text_np", v));
|
assertU(adoc("id","2", "text",v, "text_np", v));
|
||||||
assertU(commit());
|
assertU(commit());
|
||||||
@ -307,6 +307,23 @@ public class ReturnFieldsTest extends SolrTestCaseJ4 {
|
|||||||
assertFalse(rf.wantsAllFields());
|
assertFalse(rf.wantsAllFields());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testFunkyFieldNames() {
|
||||||
|
ReturnFields rf = new SolrReturnFields(req("fl", "#foo_s", "fl", "id"));
|
||||||
|
assertFalse(rf.wantsScore());
|
||||||
|
assertTrue(rf.wantsField("id"));
|
||||||
|
assertTrue(rf.wantsField("#foo_s"));
|
||||||
|
assertFalse(rf.wantsField("xxx"));
|
||||||
|
assertFalse(rf.wantsAllFields());
|
||||||
|
|
||||||
|
assertQ(req("q","id:1", "fl","#foo_s", "fl","id")
|
||||||
|
,"//*[@numFound='1'] "
|
||||||
|
,"//str[@name='id'][.='1']"
|
||||||
|
,"//arr[@name='#foo_s']/str[.='how now brown cow']"
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void testWhitespace() {
|
public void testWhitespace() {
|
||||||
Random r = random();
|
Random r = random();
|
||||||
final int iters = atLeast(30);
|
final int iters = atLeast(30);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user