Skip to content

Commit

Permalink
Merge pull request #51 from bavix/int-result-test
Browse files Browse the repository at this point in the history
added int64/uint64 test for returned data
  • Loading branch information
rez1dent3 committed Oct 3, 2023
2 parents 4e12816 + b86e5b4 commit 4b336f3
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 12 deletions.
6 changes: 6 additions & 0 deletions example/simple/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,5 +186,11 @@ func main() {
if r.Message != "72057594037927936 18446744073709551615" {
log.Fatalf("failed to get valid message: %v", r.Message)
}
if r.Vint64 != 72057594037927936 {
log.Fatalf("expected: 72057594037927936, received: %d", r.Vint64)
}
if r.Vuint64 != 18446744073709551615 {
log.Fatalf("expected: 18446744073709551615, received: %d", r.Vuint64)
}
log.Printf("Greeting: %s (return code %d)", r.Message, r.ReturnCode)
}
2 changes: 2 additions & 0 deletions example/simple/simple.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ message Request {
message Reply {
string message = 1;
int32 return_code = 2;
int64 vint64 = 3;
uint64 vuint64 = 4;
}
6 changes: 5 additions & 1 deletion example/simple/stub/uint64_int64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@
vuint64: 18446744073709551615
output:
data:
message: "72057594037927936 18446744073709551615"
message: "72057594037927936 18446744073709551615"
# {"high":72057594037927936,"low":0}
vint64: 72057594037927936
# {"high":18446744073709551615,"low":18446744073709551615}
vuint64: 18446744073709551615
39 changes: 29 additions & 10 deletions protogen/example/simple/simple.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion protogen/example/simple/simple_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4b336f3

Please sign in to comment.