1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-12 13:20:40 +00:00

fix test case

This commit is contained in:
astaxie
2018-07-20 14:26:43 +08:00
parent be75f93d43
commit 8f6bce3b87
2 changed files with 6 additions and 5 deletions

View File

@ -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)