Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
61008fe7
authored
2014-05-30 14:12:21 -0500
by
Michael
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
udpated timezone in templatefunc_test. changed error message to be more descriptive when tests fail
1 parent
03080b3e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
templatefunc_test.go
templatefunc_test.go
View file @
61008fe
...
...
@@ -36,25 +36,27 @@ func TestHtml2str(t *testing.T) {
func
TestDateFormat
(
t
*
testing
.
T
)
{
ts
:=
"Mon, 01 Jul 2013 13:27:42 CST"
tt
,
_
:=
time
.
Parse
(
time
.
RFC1123
,
ts
)
if
DateFormat
(
tt
,
"2006-01-02 15:04:05"
)
!=
"2013-07-01 13:27:42"
{
t
.
Error
(
"should be equal"
)
if
ss
:=
DateFormat
(
tt
,
"2006-01-02 15:04:05"
);
ss
!=
"2013-07-01 14:27:42"
{
t
.
Errorf
(
"2013-07-01 14:27:42 does not equal %v"
,
ss
)
}
}
func
TestDate
(
t
*
testing
.
T
)
{
ts
:=
"Mon, 01 Jul 2013 13:27:42 CST"
tt
,
_
:=
time
.
Parse
(
time
.
RFC1123
,
ts
)
if
Date
(
tt
,
"Y-m-d H:i:s"
)
!=
"2013-07-01 13:27:42"
{
t
.
Error
(
"should be equal"
)
if
ss
:=
Date
(
tt
,
"Y-m-d H:i:s"
);
ss
!=
"2013-07-01 14:27:42"
{
t
.
Errorf
(
"2013-07-01 14:27:42 does not equal %v"
,
ss
)
}
if
Date
(
tt
,
"y-n-j h:i:s A"
)
!=
"13-7-1 01
:27:42 PM"
{
t
.
Error
(
"should be equal"
)
if
ss
:=
Date
(
tt
,
"y-n-j h:i:s A"
);
ss
!=
"13-7-1 02
:27:42 PM"
{
t
.
Error
f
(
"13-7-1 02:27:42 PM does not equal %v"
,
ss
)
}
if
Date
(
tt
,
"D, d M Y g:i:s a"
)
!=
"Mon, 01 Jul 2013 1
:27:42 pm"
{
t
.
Error
(
"should be equal"
)
if
ss
:=
Date
(
tt
,
"D, d M Y g:i:s a"
);
ss
!=
"Mon, 01 Jul 2013 2
:27:42 pm"
{
t
.
Error
f
(
"Mon, 01 Jul 2013 2:27:42 pm does not equal %v"
,
ss
)
}
if
Date
(
tt
,
"l, d F Y G:i:s"
)
!=
"Monday, 01 July 2013 13
:27:42"
{
t
.
Error
(
"should be equal"
)
if
ss
:=
Date
(
tt
,
"l, d F Y G:i:s"
);
ss
!=
"Monday, 01 July 2013 14
:27:42"
{
t
.
Error
f
(
"Monday, 01 July 2013 14:27:42 does not equal %v"
,
ss
)
}
}
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment