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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Douglas
jio
Commits
b33b3617
Commit
b33b3617
authored
Apr 28, 2016
by
Douglas Camata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: fixes more bugs related to timezone changing
parent
d8119ca4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
24 deletions
+29
-24
test/queries/jiodate.tests.js
test/queries/jiodate.tests.js
+10
-10
test/queries/key-jiodate.tests.js
test/queries/key-jiodate.tests.js
+5
-1
test/queries/key-schema.tests.js
test/queries/key-schema.tests.js
+6
-6
test/queries/key.tests.js
test/queries/key.tests.js
+8
-7
No files found.
test/queries/jiodate.tests.js
View file @
b33b3617
...
...
@@ -256,13 +256,13 @@
test
(
"
Comparison between heterogeneous values is done with
"
+
"
the lesser precision
"
,
function
()
{
var
dmsec
=
JIODate
(
'
2012-05-02 06:07:08.989
'
),
dsec
=
JIODate
(
'
2012-05-02 06:07:08
'
),
dmin
=
JIODate
(
'
2012-05-02 06:07
'
),
dhour
=
JIODate
(
'
2012-05-02 06
'
),
dday
=
JIODate
(
'
2012-05-02
'
),
dmonth
=
JIODate
(
'
2012-05
'
),
dyear
=
JIODate
(
'
2012
'
);
var
dmsec
=
JIODate
(
'
2012-05-02 06:07:08.989
Z
'
),
dsec
=
JIODate
(
'
2012-05-02 06:07:08
Z
'
),
dmin
=
JIODate
(
'
2012-05-02 06:07
Z
'
),
dhour
=
JIODate
(
'
2012-05-02 06
Z
'
),
dday
=
JIODate
(
'
2012-05-02
'
,
'
utc
'
),
dmonth
=
JIODate
(
'
2012-05
'
,
'
utc
'
),
dyear
=
JIODate
(
'
2012
'
,
'
utc
'
);
[
dmsec
,
dsec
,
dmin
,
dhour
,
dday
,
dmonth
,
dyear
].
map
(
function
(
jiodate
)
{
jiodate
.
utcMode
();
...
...
@@ -317,9 +317,9 @@
strictEqual
(
dyear
.
cmp
(
dday
),
0
);
strictEqual
(
dyear
.
cmp
(
dmonth
),
0
);
strictEqual
(
dmsec
.
cmp
(
JIODate
(
'
2012-05-02 06:07:07
'
)),
+
1
);
strictEqual
(
dmsec
.
cmp
(
JIODate
(
'
2012-05-02 06:07:08
'
)),
0
);
strictEqual
(
dmsec
.
cmp
(
JIODate
(
'
2012-05-02 06:07:09
'
)),
-
1
);
strictEqual
(
dmsec
.
cmp
(
JIODate
(
'
2012-05-02 06:07:07
Z
'
)),
+
1
);
strictEqual
(
dmsec
.
cmp
(
JIODate
(
'
2012-05-02 06:07:08
Z
'
)),
0
);
strictEqual
(
dmsec
.
cmp
(
JIODate
(
'
2012-05-02 06:07:09
Z
'
)),
-
1
);
});
}(
QUnit
,
jiodate
,
moment
));
test/queries/key-jiodate.tests.js
View file @
b33b3617
...
...
@@ -32,7 +32,11 @@
key_set
:
{
date
:
{
read_from
:
'
date
'
,
cast_to
:
jiodate
.
JIODate
cast_to
:
function
(
date_str
)
{
var
d
=
jiodate
.
JIODate
(
date_str
);
d
.
utcMode
();
return
d
;
}
}
}
},
query_list
=
[],
promise
=
[];
...
...
test/queries/key-schema.tests.js
View file @
b33b3617
...
...
@@ -43,19 +43,19 @@
match_lookup
:
{
sameDay
:
function
(
a
,
b
)
{
return
(
(
a
.
get
FullYear
()
===
b
.
get
FullYear
())
&&
(
a
.
get
Month
()
===
b
.
get
Month
())
&&
(
a
.
get
Date
()
===
b
.
get
Date
())
(
a
.
get
UTCFullYear
()
===
b
.
getUTC
FullYear
())
&&
(
a
.
get
UTCMonth
()
===
b
.
getUTC
Month
())
&&
(
a
.
get
UTCDate
()
===
b
.
getUTC
Date
())
);
},
sameMonth
:
function
(
a
,
b
)
{
return
(
(
a
.
get
FullYear
()
===
b
.
get
FullYear
())
&&
(
a
.
get
Month
()
===
b
.
get
Month
())
(
a
.
get
UTCFullYear
()
===
b
.
getUTC
FullYear
())
&&
(
a
.
get
UTCMonth
()
===
b
.
getUTC
Month
())
);
},
sameYear
:
function
(
a
,
b
)
{
return
(
a
.
get
FullYear
()
===
b
.
get
FullYear
());
return
(
a
.
get
UTCFullYear
()
===
b
.
getUTC
FullYear
());
},
equalState
:
translationEqualityMatcher
({
'
ouvert
'
:
'
open
'
})
},
...
...
test/queries/key.tests.js
View file @
b33b3617
...
...
@@ -80,6 +80,7 @@
// no need to clone
return
obj
;
}
return
new
Date
(
obj
);
};
...
...
@@ -98,21 +99,21 @@
var
sameDay
=
function
(
a
,
b
)
{
return
(
(
a
.
get
FullYear
()
===
b
.
get
FullYear
())
&&
(
a
.
get
Month
()
===
b
.
get
Month
())
&&
(
a
.
get
Date
()
===
b
.
get
Date
())
(
a
.
get
UTCFullYear
()
===
b
.
getUTC
FullYear
())
&&
(
a
.
get
UTCMonth
()
===
b
.
getUTC
Month
())
&&
(
a
.
get
UTCDate
()
===
b
.
getUTC
Date
())
);
};
var
sameMonth
=
function
(
a
,
b
)
{
return
(
(
a
.
get
FullYear
()
===
b
.
get
FullYear
())
&&
(
a
.
get
Month
()
===
b
.
get
Month
())
(
a
.
get
UTCFullYear
()
===
b
.
getUTC
FullYear
())
&&
(
a
.
get
UTCMonth
()
===
b
.
getUTC
Month
())
);
};
var
sameYear
=
function
(
a
,
b
)
{
return
(
a
.
get
FullYear
()
===
b
.
get
FullYear
());
return
(
a
.
get
UTCFullYear
()
===
b
.
getUTC
FullYear
());
};
var
keys
=
{
...
...
@@ -324,7 +325,7 @@
read_from
:
'
date
'
,
cast_to
:
dateCast
,
equal_match
:
function
alwaysTrue
(
o1
)
{
/*, o2*/
return
o1
.
getDate
()
===
2
;
return
o1
.
get
UTC
Date
()
===
2
;
}
}
},
promise
=
[];
...
...
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