代码拉取完成,页面将自动刷新
package dotweb
import (
"fmt"
"github.com/devfeel/dotweb/test"
"testing"
"time"
)
type testPlugin struct {
}
func (p *testPlugin) Name() string {
return "test"
}
func (p *testPlugin) Run() error {
fmt.Println(p.Name(), "runing")
//panic("error test run")
return nil
}
func (p *testPlugin) IsValidate() bool {
return true
}
func TestNotifyPlugin_Name(t *testing.T) {
app := newConfigDotWeb()
//fmt.Println(app.Config.ConfigFilePath)
p := NewDefaultNotifyPlugin(app)
needShow := "NotifyPlugin"
test.Equal(t, needShow, p.Name())
}
func TestNotifyPlugin_IsValidate(t *testing.T) {
app := newConfigDotWeb()
p := NewDefaultNotifyPlugin(app)
needShow := true
test.Equal(t, needShow, p.IsValidate())
}
func TestNotifyPlugin_Run(t *testing.T) {
app := newConfigDotWeb()
p := NewDefaultNotifyPlugin(app)
go func() {
for {
fmt.Println(p.ModTimes[app.Config.ConfigFilePath])
time.Sleep(time.Duration(600 * time.Millisecond))
}
}()
p.Run()
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。