Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Roque
jio
Commits
1d22cda3
Commit
1d22cda3
authored
Dec 31, 2013
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup after docs/ merge; renamed test modules
parent
c0381741
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
10 additions
and
124 deletions
+10
-124
Makefile
Makefile
+2
-0
README.md
README.md
+1
-1
test/queries/key-jiodate.tests.js
test/queries/key-jiodate.tests.js
+1
-1
test/queries/key-localstorage.tests.js
test/queries/key-localstorage.tests.js
+0
-0
test/queries/key-schema.tests.js
test/queries/key-schema.tests.js
+3
-5
test/queries/key.tests.js
test/queries/key.tests.js
+0
-0
test/queries/keys.eq-lt.tests.js
test/queries/keys.eq-lt.tests.js
+0
-113
test/tests.html
test/tests.html
+3
-4
No files found.
Makefile
View file @
1d22cda3
...
...
@@ -4,6 +4,7 @@ QUERIES_DIR = src/queries
# files
JIO
=
jio.js
JIO_MIN
=
jio.min.js
JIODATE_MIN
=
jiodate.min.js
COMPLEX
=
complex_queries.js
COMPLEX_MIN
=
complex_queries.min.js
PARSER_PAR
=
$(QUERIES_DIR)
/core/parser.par
...
...
@@ -90,6 +91,7 @@ clean:
realclean
:
rm
-f
"
$(JIO)
"
rm
-f
"
$(JIO_MIN)
"
rm
-f
"
$(JIODATE_MIN)
"
rm
-f
"
$(COMPLEX)
"
rm
-f
"
$(COMPLEX_MIN)
"
rm
-f
"
$(PARSER_OUT)
"
README.md
View file @
1d22cda3
...
...
@@ -5,7 +5,7 @@
### Getting Started
To set
up you should jIO
include jio.js, dependencies and the connectors for the storages
To set
up jIO you should
include jio.js, dependencies and the connectors for the storages
you want to use in the HTML page header (note that more dependencies may be required
depending on type of storages being used):
...
...
test/queries/
jiodate.key
.tests.js
→
test/queries/
key-jiodate
.tests.js
View file @
1d22cda3
...
...
@@ -15,7 +15,7 @@
}([
'
complex_queries
'
,
'
jiodate
'
,
'
qunit
'
],
function
(
complex_queries
,
jiodate
)
{
"
use strict
"
;
module
(
'
JIODate with custom keys
'
);
module
(
'
Custom Key Queries with JIODate
'
);
test
(
'
Stock comparison operators with year precision
'
,
function
()
{
var
doc_list
,
docList
=
function
()
{
...
...
test/queries/
localstorage-keys
.tests.js
→
test/queries/
key-localstorage
.tests.js
View file @
1d22cda3
File moved
test/queries/key-schema.tests.js
View file @
1d22cda3
...
...
@@ -15,6 +15,8 @@
}([
'
complex_queries
'
,
'
qunit
'
],
function
(
complex_queries
)
{
"
use strict
"
;
module
(
'
Custom Key Queries with Schema
'
);
var
translationEqualityMatcher
=
function
(
data
)
{
return
function
(
object_value
,
value
)
{
value
=
data
[
value
];
...
...
@@ -87,9 +89,6 @@
/*jslint unparam: false*/
module
(
'
Queries with Key Schema
'
);
test
(
'
Keys defined in a Schema can be used like metadata
'
,
function
()
{
var
doc_list
,
docList
=
function
()
{
return
[
...
...
@@ -247,6 +246,7 @@
],
'
Key Schema: It should be possible to look for a translated string with operator =
'
);
// XXX not implemented yet
// doc_list = docList();
// complex_queries.QueryFactory.create({
// type: 'simple',
...
...
@@ -258,8 +258,6 @@
// {'identifier': '2', 'state': 'closed'}
// ], 'Key Schema: It should be possible to look for a translated string with operator !=');
});
}));
test/queries/key
s
.tests.js
→
test/queries/key.tests.js
View file @
1d22cda3
File moved
test/queries/keys.eq-lt.tests.js
deleted
100644 → 0
View file @
c0381741
/*jslint indent: 2, maxlen: 120, nomen: true, vars: true */
/*global define, exports, require, module, complex_queries, jiodate, window, test, ok,
equal, deepEqual, sinon */
// define([module_name], [dependencies], module);
(
function
(
dependencies
,
module
)
{
"
use strict
"
;
if
(
typeof
define
===
'
function
'
&&
define
.
amd
)
{
return
define
(
dependencies
,
module
);
}
if
(
typeof
exports
===
'
object
'
)
{
return
module
(
require
(
'
complex_queries
'
),
require
(
'
jiodate
'
));
}
module
(
complex_queries
,
jiodate
);
}([
'
complex_queries
'
,
'
jiodate
'
,
'
qunit
'
],
function
(
complex_queries
,
jiodate
)
{
"
use strict
"
;
module
(
'
Custom keys: fallback to < and = for missing operators
'
);
test
(
'
Stock comparison operators with year precision
'
,
function
()
{
var
doc_list
,
docList
=
function
()
{
return
[
{
'
identifier
'
:
'
twenty ten
'
,
'
date
'
:
'
2010-03-04T08:52:13.746Z
'
},
{
'
identifier
'
:
'
twenty eleven
'
,
'
date
'
:
'
2011-03-04T08:52:13.746Z
'
},
{
'
identifier
'
:
'
twenty twelve
'
,
'
date
'
:
'
2012-03-04T08:52:13.746Z
'
}
];
},
key_schema
=
{
key_set
:
{
date
:
{
read_from
:
'
date
'
,
cast_to
:
jiodate
.
JIODate
}
}
};
jiodate
.
JIODate
.
prototype
.
ne
=
undefined
;
jiodate
.
JIODate
.
prototype
.
le
=
undefined
;
jiodate
.
JIODate
.
prototype
.
gt
=
undefined
;
jiodate
.
JIODate
.
prototype
.
ge
=
undefined
;
doc_list
=
docList
();
complex_queries
.
QueryFactory
.
create
({
type
:
'
simple
'
,
key
:
'
date
'
,
value
:
'
2011
'
},
key_schema
).
exec
(
doc_list
);
deepEqual
(
doc_list
,
[
{
'
date
'
:
'
2011-03-04T08:52:13.746Z
'
,
'
identifier
'
:
'
twenty eleven
'
}
],
'
Match with "date = 2011" (query tree form)
'
);
doc_list
=
docList
();
complex_queries
.
QueryFactory
.
create
({
type
:
'
simple
'
,
key
:
'
date
'
,
operator
:
'
!=
'
,
value
:
'
2011
'
},
key_schema
).
exec
(
doc_list
);
deepEqual
(
doc_list
,
[
{
'
date
'
:
'
2010-03-04T08:52:13.746Z
'
,
'
identifier
'
:
'
twenty ten
'
},
{
'
date
'
:
'
2012-03-04T08:52:13.746Z
'
,
'
identifier
'
:
'
twenty twelve
'
}
],
'
Match with "date != 2011" (query tree form)
'
);
doc_list
=
docList
();
complex_queries
.
QueryFactory
.
create
({
type
:
'
simple
'
,
key
:
'
date
'
,
operator
:
'
<
'
,
value
:
'
2011
'
},
key_schema
).
exec
(
doc_list
);
deepEqual
(
doc_list
,
[
{
'
date
'
:
'
2010-03-04T08:52:13.746Z
'
,
'
identifier
'
:
'
twenty ten
'
}
],
'
Match with "date < 2011" (query tree form)
'
);
doc_list
=
docList
();
complex_queries
.
QueryFactory
.
create
({
type
:
'
simple
'
,
key
:
'
date
'
,
operator
:
'
<=
'
,
value
:
'
2011
'
},
key_schema
).
exec
(
doc_list
);
deepEqual
(
doc_list
,
[
{
'
date
'
:
'
2010-03-04T08:52:13.746Z
'
,
'
identifier
'
:
'
twenty ten
'
},
{
'
date
'
:
'
2011-03-04T08:52:13.746Z
'
,
'
identifier
'
:
'
twenty eleven
'
}
],
'
Match with "date <= 2011" (query tree form)
'
);
doc_list
=
docList
();
complex_queries
.
QueryFactory
.
create
({
type
:
'
simple
'
,
key
:
'
date
'
,
operator
:
'
>
'
,
value
:
'
2011
'
},
key_schema
).
exec
(
doc_list
);
deepEqual
(
doc_list
,
[
{
'
date
'
:
'
2012-03-04T08:52:13.746Z
'
,
'
identifier
'
:
'
twenty twelve
'
}
],
'
Match with "date > 2011" (query tree form)
'
);
doc_list
=
docList
();
complex_queries
.
QueryFactory
.
create
({
type
:
'
simple
'
,
key
:
'
date
'
,
operator
:
'
>=
'
,
value
:
'
2011
'
},
key_schema
).
exec
(
doc_list
);
deepEqual
(
doc_list
,
[
{
'
date
'
:
'
2011-03-04T08:52:13.746Z
'
,
'
identifier
'
:
'
twenty eleven
'
},
{
'
date
'
:
'
2012-03-04T08:52:13.746Z
'
,
'
identifier
'
:
'
twenty twelve
'
}
],
'
Match with "date >= 2011" (query tree form)
'
);
});
}));
test/tests.html
View file @
1d22cda3
...
...
@@ -19,7 +19,7 @@
<script
src=
"jio/tests.js"
></script>
<script
src=
"../complex_queries.js"
></script>
<script
src=
"queries/key
s
.tests.js"
></script>
<script
src=
"queries/key.tests.js"
></script>
<script
src=
"queries/key-schema.tests.js"
></script>
<script
src=
"queries/tests.js"
></script>
<script
src=
"queries/key-typechecks.tests.js"
></script>
...
...
@@ -27,11 +27,10 @@
<script
src=
"../lib/moment/moment-2.5.0.js"
></script>
<script
src=
"../src/jio.date/jiodate.js"
></script>
<script
src=
"queries/jiodate.tests.js"
></script>
<script
src=
"queries/jiodate.key.tests.js"
></script>
<script
src=
"queries/keys.eq-lt.tests.js"
></script>
<script
src=
"queries/key-jiodate.tests.js"
></script>
<script
src=
"../src/jio.storage/localstorage.js"
></script>
<script
src=
"queries/
localstorage-keys
.tests.js"
></script>
<script
src=
"queries/
key-localstorage
.tests.js"
></script>
<script
src=
"jio.storage/localstorage.tests.js"
></script>
<script
src=
"../src/jio.storage/davstorage.js"
></script>
...
...
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