@@ -29,12 +29,12 @@ import (
2929)
3030
3131func (s ) TestAddGlobalDialOptions (t * testing.T ) {
32- // Ensure the Dial fails without credentials
33- if _ , err := Dial ("fake" ); err == nil {
34- t .Fatalf ("Dialing without a credential did not fail" )
32+ // Ensure the NewClient fails without credentials
33+ if _ , err := NewClient ("fake" ); err == nil {
34+ t .Fatalf ("NewClient without a credential did not fail" )
3535 } else {
3636 if ! strings .Contains (err .Error (), "no transport security set" ) {
37- t .Fatalf ("Dialing failed with unexpected error: %v" , err )
37+ t .Fatalf ("NewClient failed with unexpected error: %v" , err )
3838 }
3939 }
4040
@@ -48,9 +48,9 @@ func (s) TestAddGlobalDialOptions(t *testing.T) {
4848 }
4949 }
5050
51- // Ensure the Dial passes with the extra dial options
52- if cc , err := Dial ("fake" ); err != nil {
53- t .Fatalf ("Dialing with insecure credential failed: %v" , err )
51+ // Ensure the NewClient passes with the extra dial options
52+ if cc , err := NewClient ("fake" ); err != nil {
53+ t .Fatalf ("NewClient with insecure credential failed: %v" , err )
5454 } else {
5555 cc .Close ()
5656 }
@@ -71,8 +71,8 @@ func (s) TestDisableGlobalOptions(t *testing.T) {
7171 // due to the global dial options with credentials not being picked up due
7272 // to global options being disabled.
7373 noTSecStr := "no transport security set"
74- if _ , err := Dial ("fake" , internal .DisableGlobalDialOptions .(func () DialOption )()); ! strings .Contains (fmt .Sprint (err ), noTSecStr ) {
75- t .Fatalf ("Dialing received unexpected error: %v, want error containing \" %v \" " , err , noTSecStr )
74+ if _ , err := NewClient ("fake" , internal .DisableGlobalDialOptions .(func () DialOption )()); ! strings .Contains (fmt .Sprint (err ), noTSecStr ) {
75+ t .Fatalf ("NewClient received unexpected error: %v, want error containing %q " , err , noTSecStr )
7676 }
7777}
7878
@@ -95,11 +95,11 @@ func (s) TestGlobalPerTargetDialOption(t *testing.T) {
9595 defer internal .ClearGlobalPerTargetDialOptions ()
9696 noTSecStr := "no transport security set"
9797 if _ , err := NewClient ("dns:///fake" ); ! strings .Contains (fmt .Sprint (err ), noTSecStr ) {
98- t .Fatalf ("Dialing received unexpected error: %v, want error containing \" %v \" " , err , noTSecStr )
98+ t .Fatalf ("NewClient received unexpected error: %v, want error containing %q " , err , noTSecStr )
9999 }
100100 cc , err := NewClient ("passthrough:///nice" )
101101 if err != nil {
102- t .Fatalf ("Dialing with insecure credentials failed: %v" , err )
102+ t .Fatalf ("NewClient with insecure credentials failed: %v" , err )
103103 }
104104 cc .Close ()
105105}
@@ -135,9 +135,9 @@ func (s) TestJoinDialOption(t *testing.T) {
135135 const maxRecvSize = 998765
136136 const initialWindowSize = 100
137137 jdo := newJoinDialOption (WithTransportCredentials (insecure .NewCredentials ()), WithReadBufferSize (maxRecvSize ), WithInitialWindowSize (initialWindowSize ))
138- cc , err := Dial ("fake" , jdo )
138+ cc , err := NewClient ("fake" , jdo )
139139 if err != nil {
140- t .Fatalf ("Dialing with insecure credentials failed: %v" , err )
140+ t .Fatalf ("NewClient with insecure credentials failed: %v" , err )
141141 }
142142 defer cc .Close ()
143143 if cc .dopts .copts .ReadBufferSize != maxRecvSize {
0 commit comments