Commit 8f6bce3b authored by astaxie's avatar astaxie

fix test case

parent be75f93d
...@@ -135,7 +135,7 @@ func TestFileRotate_01(t *testing.T) { ...@@ -135,7 +135,7 @@ func TestFileRotate_01(t *testing.T) {
func TestFileRotate_02(t *testing.T) { func TestFileRotate_02(t *testing.T) {
fn1 := "rotate_day.log" 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) testFileRotate(t, fn1, fn2)
} }
...@@ -150,7 +150,7 @@ func TestFileRotate_03(t *testing.T) { ...@@ -150,7 +150,7 @@ func TestFileRotate_03(t *testing.T) {
func TestFileRotate_04(t *testing.T) { func TestFileRotate_04(t *testing.T) {
fn1 := "rotate_day.log" 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) testFileDailyRotate(t, fn1, fn2)
} }
...@@ -200,6 +200,7 @@ func testFileRotate(t *testing.T, fn1, fn2 string) { ...@@ -200,6 +200,7 @@ func testFileRotate(t *testing.T, fn1, fn2 string) {
for _, file := range []string{fn1, fn2} { for _, file := range []string{fn1, fn2} {
_, err := os.Stat(file) _, err := os.Stat(file)
if err != nil { if err != nil {
t.Log(err)
t.FailNow() t.FailNow()
} }
os.Remove(file) os.Remove(file)
......
...@@ -94,7 +94,7 @@ func TestCompareRelated(t *testing.T) { ...@@ -94,7 +94,7 @@ func TestCompareRelated(t *testing.T) {
} }
func TestHtmlquote(t *testing.T) { func TestHtmlquote(t *testing.T) {
h := `<' ”“&">` h := `<' ”“&">`
s := `<' ”“&">` s := `<' ”“&">`
if Htmlquote(s) != h { if Htmlquote(s) != h {
t.Error("should be equal") t.Error("should be equal")
...@@ -102,8 +102,8 @@ func TestHtmlquote(t *testing.T) { ...@@ -102,8 +102,8 @@ func TestHtmlquote(t *testing.T) {
} }
func TestHtmlunquote(t *testing.T) { func TestHtmlunquote(t *testing.T) {
h := `&lt;&#39;&nbsp;&rdquo;&ldquo;&amp;&quot;&gt;` h := `&lt;&#39;&nbsp;&rdquo;&ldquo;&amp;&#34;&gt;`
s := `<' ”“&">` s := `<' ”“&">`
if Htmlunquote(h) != s { if Htmlunquote(h) != s {
t.Error("should be equal") t.Error("should be equal")
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment