package player

import (
	"netease_control_center/globals"
	"netease_control_center/interfaces/log"
	"testing"
	"time"
)

func a(arg ...interface{}) {
	log.Println(log.DebugLog, "a len:", len(arg))
	b(arg...)
}

func b(arg ...interface{}) {
	log.Println(log.DebugLog, "b len:", len(arg))
}

func Test_interface(t *testing.T) {
	defer func() {
		t.Log("defer 1")
	}()

	defer func() {
		t.Log("defer 2")
	}()

	a("he", "he")

	var chanTest chan bool = make(chan bool, 1)
	cnt := 0
	for {
		t.Log("begin:", cnt, " time:", time.Now().UTC())
		select {
		case <-chanTest:
			t.Log("over")
		case tinfo := <-time.NewTimer(1 * time.Second).C:
			if cnt < 3 {
				cnt++
				t.Log("try:", cnt, "time:", time.Now().UTC())
				t.Log("tinfo:", tinfo)
				continue
			}
		}
		return

	}
}

func TestGetDataStr(t *testing.T) {
	t.Log(globals.GetDateStr())
}
