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

LEX bug test #1186

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions test/panic/lexical.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,33 @@ describe('RAD Lexical search Test! ', function() {
config: config
});
});
it('Query server - Prefix Higher match(* >) ', function() {
var i=0;
return server.run(function(test) {
var env = test.props;
var t = setTimeout(function() { test.fail('Error: No response.');}, 5000);
var results = [];
var query = { '%': 100000, '.': { '*': '2020-10-', '>': '2020-10-16' } };
test.async();
ref.get(query).map().once(function(v, k) {
if (k && v) { results.push(k); }
});
var t2 = setTimeout(function() {
var len = 16; /// expected number of results
var results_unique = results.filter(function(v, i, a) { return a.indexOf(v) === i; }).sort();
clearTimeout(t);
if (results_unique.length === len) {
test.done();
} else {
console.log('RESULTS Query server - Prefix Higher match(* >): ', results_unique.length, results_unique);
test.fail('Error: get ' + results_unique.length + ' attributes istead of '+len);
}
}, env.config.wait_map);
}, {
i: i += 1,
config: config
});
});

it(config.browsers + ' browser(s) have joined! ', function() {
console.log('PLEASE OPEN http://' + config.IP + ':' + config.port + ' IN ' + config.browsers + ' BROWSER(S)!');
Expand Down Expand Up @@ -428,6 +455,36 @@ describe('RAD Lexical search Test! ', function() {
});
return Promise.all(tests);
});
it('Query browser - Prefix Higher match(* >) ', function() {
var tests = [], i = 0;
browsers.each(function(client, id) {
tests.push(client.run(function(test) {
var env = test.props;
var t = setTimeout(function() { test.fail('Error: No response.');}, 5000);
var results = [];
var query = { '%': 100000, '.': { '*': '2020-10-', '>': '2020-10-16' } };
test.async();
ref.get(query).map().once(function(v, k) {
if (k && v) { results.push(k); }
});
var t2 = setTimeout(function() {
var len = 16; /// expected number of results
var results_unique = results.filter(function(v, i, a) { return a.indexOf(v) === i; }).sort();
clearTimeout(t);
if (results_unique.length === len) {
test.done();
} else {
console.log('RESULTS Query browser - Prefix match(*): ', results_unique.length, results_unique);
test.fail('Error: get ' + results_unique.length + ' attributes istead of '+len);
}
}, env.config.wait_map);
}, {
i: i += 1,
config: config
}));
});
return Promise.all(tests);
});

////////////////////////////////
it("Wait...", function(done){
Expand Down