You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
479 B

  1. /**
  2. * @Author: Aceld
  3. * @Date: 2019/4/30 15:17
  4. * @Mail: danbing.at@gmail.com
  5. *
  6. * 针对 delayFunc.go 做单元测试主要测试延迟函数结构体是否正常使用
  7. */
  8. package ztimer
  9. import (
  10. "fmt"
  11. "testing"
  12. )
  13. func SayHello(message ...interface{}) {
  14. fmt.Println(message[0].(string), " ", message[1].(string))
  15. }
  16. func TestDelayfunc(t *testing.T) {
  17. df := NewDelayFunc(SayHello, []interface{}{"hello", "zinx!"})
  18. fmt.Println("df.String() = ", df.String())
  19. df.Call()
  20. }