github.com/sixexorg/magnetic-ring@v0.0.0-20191119090307-31705a21e419/radar/mainchain/league_consumes_test.go (about) 1 package mainchain 2 3 import ( 4 "fmt" 5 "testing" 6 ) 7 8 func TestAAA(t *testing.T) { 9 c := make(chan bool, 1) 10 h := make(chan bool, 1) 11 go func() { 12 for { 13 select { 14 case <-c: 15 h <- false 16 fmt.Println("break") 17 break 18 } 19 fmt.Println("234") 20 21 } 22 }() 23 c <- true 24 fmt.Println(<-h) 25 select {} 26 } 27 28 func TestMap(t *testing.T) { 29 m := make(map[int]bool) 30 m[1] = true 31 if !m[2] { 32 fmt.Println("123") 33 } 34 }