use of com.python.pydev.analysis.additionalinfo.AdditionalInfoFileStub in project Pydev by fabioz.
the class SearchIndexQueryTest method testSearchQuery.
public void testSearchQuery() throws Exception {
PySearchIndexQuery query = new PySearchIndexQuery("my");
String text = "rara\nmy\nnomyno\nmy";
IDocument doc = new Document(text);
IFile f = new AdditionalInfoFileStub("stub") {
@Override
public long getModificationStamp() {
return 0;
}
};
AbstractTextSearchResult searchResult = new PySearchResult(null);
query.createMatches(doc, text, query.createStringMatcher(), f, searchResult, new ModulesKey("my", null));
assertEquals(2, searchResult.getMatchCount());
}
use of com.python.pydev.analysis.additionalinfo.AdditionalInfoFileStub in project Pydev by fabioz.
the class SearchIndexQueryTest method testSearchQuery2.
public void testSearchQuery2() throws Exception {
PySearchIndexQuery query = new PySearchIndexQuery("*my");
String text = "rara\nmy\nnomyno\nmy";
IDocument doc = new Document(text);
IFile f = new AdditionalInfoFileStub("stub") {
@Override
public long getModificationStamp() {
return 0;
}
};
AbstractTextSearchResult searchResult = new PySearchResult(null);
query.createMatches(doc, text, query.createStringMatcher(), f, searchResult, new ModulesKey("my", null));
assertEquals(2, searchResult.getMatchCount());
}
use of com.python.pydev.analysis.additionalinfo.AdditionalInfoFileStub in project Pydev by fabioz.
the class SearchIndexQueryTest method testSearchQuery3.
public void testSearchQuery3() throws Exception {
PySearchIndexQuery query = new PySearchIndexQuery("*my*");
String text = "rara\nmy\nnomyno\nmy";
IDocument doc = new Document(text);
IFile f = new AdditionalInfoFileStub("stub") {
@Override
public long getModificationStamp() {
return 0;
}
};
AbstractTextSearchResult searchResult = new PySearchResult(null);
query.createMatches(doc, text, query.createStringMatcher(), f, searchResult, new ModulesKey("my", null));
assertEquals(3, searchResult.getMatchCount());
}
Aggregations