Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
a65ad1a4
Commit
a65ad1a4
authored
May 31, 2014
by
astaxie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the time test case
parent
bdc01f52
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
templatefunc_test.go
templatefunc_test.go
+10
-10
No files found.
templatefunc_test.go
View file @
a65ad1a4
...
...
@@ -37,8 +37,8 @@ func TestDateFormat(t *testing.T) {
ts
:=
"Mon, 01 Jul 2013 13:27:42 CST"
tt
,
_
:=
time
.
Parse
(
time
.
RFC1123
,
ts
)
if
ss
:=
DateFormat
(
tt
,
"2006-01-02 15:04:05"
);
ss
!=
"2013-07-01 1
4
:27:42"
{
t
.
Errorf
(
"2013-07-01 1
4
:27:42 does not equal %v"
,
ss
)
if
ss
:=
DateFormat
(
tt
,
"2006-01-02 15:04:05"
);
ss
!=
"2013-07-01 1
3
:27:42"
{
t
.
Errorf
(
"2013-07-01 1
3
:27:42 does not equal %v"
,
ss
)
}
}
...
...
@@ -46,17 +46,17 @@ func TestDate(t *testing.T) {
ts
:=
"Mon, 01 Jul 2013 13:27:42 CST"
tt
,
_
:=
time
.
Parse
(
time
.
RFC1123
,
ts
)
if
ss
:=
Date
(
tt
,
"Y-m-d H:i:s"
);
ss
!=
"2013-07-01 1
4
:27:42"
{
t
.
Errorf
(
"2013-07-01 1
4
:27:42 does not equal %v"
,
ss
)
if
ss
:=
Date
(
tt
,
"Y-m-d H:i:s"
);
ss
!=
"2013-07-01 1
3
:27:42"
{
t
.
Errorf
(
"2013-07-01 1
3
:27:42 does not equal %v"
,
ss
)
}
if
ss
:=
Date
(
tt
,
"y-n-j h:i:s A"
);
ss
!=
"13-7-1 0
2
:27:42 PM"
{
t
.
Errorf
(
"13-7-1 0
2
:27:42 PM does not equal %v"
,
ss
)
if
ss
:=
Date
(
tt
,
"y-n-j h:i:s A"
);
ss
!=
"13-7-1 0
1
:27:42 PM"
{
t
.
Errorf
(
"13-7-1 0
1
:27:42 PM does not equal %v"
,
ss
)
}
if
ss
:=
Date
(
tt
,
"D, d M Y g:i:s a"
);
ss
!=
"Mon, 01 Jul 2013
2
:27:42 pm"
{
t
.
Errorf
(
"Mon, 01 Jul 2013
2
:27:42 pm does not equal %v"
,
ss
)
if
ss
:=
Date
(
tt
,
"D, d M Y g:i:s a"
);
ss
!=
"Mon, 01 Jul 2013
1
:27:42 pm"
{
t
.
Errorf
(
"Mon, 01 Jul 2013
1
:27:42 pm does not equal %v"
,
ss
)
}
if
ss
:=
Date
(
tt
,
"l, d F Y G:i:s"
);
ss
!=
"Monday, 01 July 2013 1
4
:27:42"
{
t
.
Errorf
(
"Monday, 01 July 2013 1
4
:27:42 does not equal %v"
,
ss
)
if
ss
:=
Date
(
tt
,
"l, d F Y G:i:s"
);
ss
!=
"Monday, 01 July 2013 1
3
:27:42"
{
t
.
Errorf
(
"Monday, 01 July 2013 1
3
:27:42 does not equal %v"
,
ss
)
}
}
...
...
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