-
Notifications
You must be signed in to change notification settings - Fork 826
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
revert to original status and add server-side err suffix
- Loading branch information
1 parent
8683021
commit 62e6e92
Showing
7 changed files
with
85 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package grpc | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/cloudwego/kitex/internal/test" | ||
) | ||
|
||
func TestStream_SetSourceService(t *testing.T) { | ||
s := new(Stream) | ||
testSvc := "test service" | ||
testErrMsg := "test err" | ||
testErrMsgTpl := "test err: %s" | ||
testErrMsgVal := "val" | ||
test.Assert(t, s.getSourceService() == "remote service") | ||
test.Assert(t, s.getRemoteErrMsg(testErrMsg) == "test err[triggered by remote service]") | ||
test.Assert(t, s.getRemoteErrMsgf(testErrMsgTpl, testErrMsgVal) == "test err: val[triggered by remote service]") | ||
|
||
s.SetSourceService(testSvc) | ||
test.Assert(t, s.getSourceService() == "test service") | ||
test.Assert(t, s.getRemoteErrMsg(testErrMsg) == "test err[triggered by test service]") | ||
test.Assert(t, s.getRemoteErrMsgf(testErrMsgTpl, testErrMsgVal) == "test err: val[triggered by test service]") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters