23 lines
518 B
Go
23 lines
518 B
Go
package outbound
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/sagernet/sing-box/option"
|
|
)
|
|
|
|
func TestOutboundServer(t *testing.T) {
|
|
server, loaded := outboundServer(&option.SOCKSOutboundOptions{
|
|
ServerOptions: option.ServerOptions{
|
|
Server: "EXAMPLE.COM",
|
|
ServerPort: 1080,
|
|
},
|
|
})
|
|
if !loaded || server != "example.com:1080" {
|
|
t.Fatalf("outboundServer() = %q, %v", server, loaded)
|
|
}
|
|
if _, loaded = outboundServer(&option.DirectOutboundOptions{}); loaded {
|
|
t.Fatal("outbound without server was accepted")
|
|
}
|
|
}
|