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
8f6bce3b
Commit
8f6bce3b
authored
Jul 20, 2018
by
astaxie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix test case
parent
be75f93d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
file_test.go
logs/file_test.go
+3
-2
templatefunc_test.go
templatefunc_test.go
+3
-3
No files found.
logs/file_test.go
View file @
8f6bce3b
...
...
@@ -135,7 +135,7 @@ func TestFileRotate_01(t *testing.T) {
func
TestFileRotate_02
(
t
*
testing
.
T
)
{
fn1
:=
"rotate_day.log"
fn2
:=
"rotate_day."
+
time
.
Now
()
.
Add
(
-
24
*
time
.
Hour
)
.
Format
(
"2006-01-02"
)
+
".log"
fn2
:=
"rotate_day."
+
time
.
Now
()
.
Add
(
-
24
*
time
.
Hour
)
.
Format
(
"2006-01-02"
)
+
".
001.
log"
testFileRotate
(
t
,
fn1
,
fn2
)
}
...
...
@@ -150,7 +150,7 @@ func TestFileRotate_03(t *testing.T) {
func
TestFileRotate_04
(
t
*
testing
.
T
)
{
fn1
:=
"rotate_day.log"
fn2
:=
"rotate_day."
+
time
.
Now
()
.
Add
(
-
24
*
time
.
Hour
)
.
Format
(
"2006-01-02"
)
+
".log"
fn2
:=
"rotate_day."
+
time
.
Now
()
.
Add
(
-
24
*
time
.
Hour
)
.
Format
(
"2006-01-02"
)
+
".
001.
log"
testFileDailyRotate
(
t
,
fn1
,
fn2
)
}
...
...
@@ -200,6 +200,7 @@ func testFileRotate(t *testing.T, fn1, fn2 string) {
for
_
,
file
:=
range
[]
string
{
fn1
,
fn2
}
{
_
,
err
:=
os
.
Stat
(
file
)
if
err
!=
nil
{
t
.
Log
(
err
)
t
.
FailNow
()
}
os
.
Remove
(
file
)
...
...
templatefunc_test.go
View file @
8f6bce3b
...
...
@@ -94,7 +94,7 @@ func TestCompareRelated(t *testing.T) {
}
func
TestHtmlquote
(
t
*
testing
.
T
)
{
h
:=
`<' ”“&&
quot
;>`
h
:=
`<' ”“&&
#34
;>`
s
:=
`<' ”“&">`
if
Htmlquote
(
s
)
!=
h
{
t
.
Error
(
"should be equal"
)
...
...
@@ -102,8 +102,8 @@ func TestHtmlquote(t *testing.T) {
}
func
TestHtmlunquote
(
t
*
testing
.
T
)
{
h
:=
`<' ”“&&
quot
;>`
s
:=
`<'
”“&">`
h
:=
`<' ”“&&
#34
;>`
s
:=
`<'
”“&">`
if
Htmlunquote
(
h
)
!=
s
{
t
.
Error
(
"should be equal"
)
}
...
...
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