mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-20 06:13:51 +08:00
25 lines
332 B
Go
25 lines
332 B
Go
package timer
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
func TestNextWakeTime(t *testing.T) {
|
|
logrus.SetLevel(logrus.DebugLevel)
|
|
ts := &Timer{}
|
|
ts.SetMonth(-1)
|
|
ts.SetWeek(6)
|
|
ts.SetHour(16)
|
|
ts.SetMinute(30)
|
|
t1 := time.Until(ts.nextWakeTime())
|
|
if t1 < 0 {
|
|
t.Log(t1)
|
|
t.Fail()
|
|
}
|
|
t.Log(t1)
|
|
t.Fail()
|
|
}
|