mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
Merge bc676aef8b416345daa1e3313eb9d0270db934e1 into ff4bf9293c1afa85b09eb6027d841a611521c0c6
This commit is contained in:
commit
df1634bdb3
@ -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)!');
|
||||
@ -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){
|
||||
|
Loading…
x
Reference in New Issue
Block a user