mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-24 09:40:24 +08:00
23 lines
385 B
Go
23 lines
385 B
Go
|
package ctx
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
func TestBackground(t *testing.T) {
|
||
|
workDir := "."
|
||
|
ctx, err := Prepare(workDir)
|
||
|
assert.Nil(t, err)
|
||
|
assert.True(t, true, func() bool {
|
||
|
return len(ctx.Dir) != 0 && len(ctx.Path) != 0
|
||
|
}())
|
||
|
}
|
||
|
|
||
|
func TestBackgroundNilWorkDir(t *testing.T) {
|
||
|
workDir := ""
|
||
|
_, err := Prepare(workDir)
|
||
|
assert.NotNil(t, err)
|
||
|
}
|