Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
jio
Commits
0a1e517d
Commit
0a1e517d
authored
Jan 20, 2016
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Queries: ensure that default search string works with non ascii character
parent
230d0323
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
test/queries/tests.js
test/queries/tests.js
+16
-1
No files found.
test/queries/tests.js
View file @
0a1e517d
/*jslint indent: 2, maxlen: 80, nomen: true */
/*jslint indent: 2, maxlen: 80, nomen: true */
/*global define, exports, require, module, jIO, window, test, ok,
/*global define, exports, require, module, jIO, window, test, ok,
deepEqual, stop, start */
deepEqual, stop, start
, expect
*/
// define([module_name], [dependencies], module);
// define([module_name], [dependencies], module);
(
function
(
dependencies
,
module
)
{
(
function
(
dependencies
,
module
)
{
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
{
"
identifier
"
:
[
"
b
"
,
"
c
"
]}
{
"
identifier
"
:
[
"
b
"
,
"
c
"
]}
];
];
stop
();
stop
();
expect
(
1
);
jIO
.
QueryFactory
.
create
(
''
).
exec
(
doc_list
).
jIO
.
QueryFactory
.
create
(
''
).
exec
(
doc_list
).
then
(
function
(
doc_list
)
{
then
(
function
(
doc_list
)
{
deepEqual
(
doc_list
,
[
deepEqual
(
doc_list
,
[
...
@@ -39,6 +40,7 @@
...
@@ -39,6 +40,7 @@
{
"
identifier
"
:
[
"
b
"
,
"
c
"
]}
{
"
identifier
"
:
[
"
b
"
,
"
c
"
]}
];
];
stop
();
stop
();
expect
(
2
);
jIO
.
QueryFactory
.
create
(
'
identifier: "a"
'
).
exec
(
doc_list
).
jIO
.
QueryFactory
.
create
(
'
identifier: "a"
'
).
exec
(
doc_list
).
then
(
function
(
doc_list
)
{
then
(
function
(
doc_list
)
{
deepEqual
(
doc_list
,
[
deepEqual
(
doc_list
,
[
...
@@ -66,6 +68,7 @@
...
@@ -66,6 +68,7 @@
{
"
identifier
"
:
[
"
b
"
,
"
c
"
]}
{
"
identifier
"
:
[
"
b
"
,
"
c
"
]}
];
];
stop
();
stop
();
expect
(
3
);
jIO
.
QueryFactory
.
create
(
jIO
.
QueryFactory
.
create
(
'
identifier: "b" AND identifier: "c"
'
'
identifier: "b" AND identifier: "c"
'
).
exec
(
doc_list
).
then
(
function
(
doc_list
)
{
).
exec
(
doc_list
).
then
(
function
(
doc_list
)
{
...
@@ -108,6 +111,7 @@
...
@@ -108,6 +111,7 @@
{
"
identifier
"
:
[
"
a
"
,
"
b
"
]}
{
"
identifier
"
:
[
"
a
"
,
"
b
"
]}
];
];
stop
();
stop
();
expect
(
4
);
jIO
.
QueryFactory
.
create
(
jIO
.
QueryFactory
.
create
(
'
(identifier: "%测试一%" OR identifier: "%测试二%") AND identifier: "%测试四%"
'
'
(identifier: "%测试一%" OR identifier: "%测试二%") AND identifier: "%测试四%"
'
)
)
...
@@ -145,6 +149,15 @@
...
@@ -145,6 +149,15 @@
deepEqual
(
doc_list
,
[
deepEqual
(
doc_list
,
[
{
"
identifier
"
:
"
测试一
"
,
"
title
"
:
"
标题
"
}
{
"
identifier
"
:
"
测试一
"
,
"
title
"
:
"
标题
"
}
],
'
Only second document should be kept
'
);
],
'
Only second document should be kept
'
);
return
jIO
.
QueryFactory
.
create
(
'
测试
'
)
.
exec
(
doc_list
);
})
.
then
(
function
(
doc_list
)
{
deepEqual
(
doc_list
,
[],
'
No document should be kept
'
);
})
.
fail
(
function
(
error
)
{
ok
(
false
,
error
);
}).
always
(
start
);
}).
always
(
start
);
});
});
...
@@ -156,6 +169,7 @@
...
@@ -156,6 +169,7 @@
{
"
identifier
"
:
[
"
ab
"
,
"
b
"
]}
{
"
identifier
"
:
[
"
ab
"
,
"
b
"
]}
];
];
stop
();
stop
();
expect
(
4
);
jIO
.
QueryFactory
.
create
(
'
identifier: "a%"
'
).
exec
(
jIO
.
QueryFactory
.
create
(
'
identifier: "a%"
'
).
exec
(
doc_list
doc_list
).
then
(
function
(
doc_list
)
{
).
then
(
function
(
doc_list
)
{
...
@@ -222,6 +236,7 @@
...
@@ -222,6 +236,7 @@
{
"
identifier
"
:
"
b
"
,
"
title
"
:
"
d
"
}
{
"
identifier
"
:
"
b
"
,
"
title
"
:
"
d
"
}
];
];
stop
();
stop
();
expect
(
1
);
jIO
.
QueryFactory
.
create
(
''
).
exec
(
doc_list
,
{
jIO
.
QueryFactory
.
create
(
''
).
exec
(
doc_list
,
{
"
select_list
"
:
[
"
title
"
],
"
select_list
"
:
[
"
title
"
],
"
limit
"
:
[
2
,
1
],
"
limit
"
:
[
2
,
1
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment