1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-13 04:20:39 +00:00
This commit is contained in:
Ming Deng
2020-08-05 06:34:54 +00:00
parent 6c6cf91741
commit 261b704d8b
15 changed files with 19 additions and 334 deletions

View File

@ -18,6 +18,8 @@ import (
"path/filepath"
"reflect"
"testing"
"github.com/stretchr/testify/assert"
)
var noExistedFile = "/tmp/not_existed_file"
@ -66,9 +68,8 @@ func TestGrepFile(t *testing.T) {
path := filepath.Join(".", "testdata", "grepe.test")
lines, err := GrepFile(`^\s*[^#]+`, path)
if err != nil {
t.Error(err)
}
assert.Nil(t, err)
if !reflect.DeepEqual(lines, []string{"hello", "world"}) {
t.Errorf("expect [hello world], but receive %v", lines)
}