github.com/v2fly/v2ray-core/v5@v5.16.2-0.20240507031116-8191faa6e095/common/signal/notifier_test.go (about)

     1  package signal_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	. "github.com/v2fly/v2ray-core/v5/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  }