github.com/xtls/xray-core@v1.8.12-0.20240518155711-3168d27b0bdb/common/signal/notifier_test.go (about)

     1  package signal_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	. "github.com/xtls/xray-core/common/signal"
     7  )
     8  
     9  func TestNotifierSignal(t *testing.T) {
    10  	n := NewNotifier()
    11  
    12  	w := n.Wait()
    13  	n.Signal()
    14  
    15  	select {
    16  	case <-w:
    17  	default:
    18  		t.Fail()
    19  	}
    20  }