From cfedcab5abdb982e75b1c2489b117e2443c0cac1 Mon Sep 17 00:00:00 2001 From: "Daniel G. Taylor" Date: Sun, 20 Oct 2019 22:49:53 -0700 Subject: [PATCH] Add basic oneof tests --- README.md | 4 ++++ betterproto/tests/oneof-name.json | 3 +++ betterproto/tests/oneof.json | 3 +++ betterproto/tests/oneof.proto | 8 ++++++++ 4 files changed, 18 insertions(+) create mode 100644 betterproto/tests/oneof-name.json create mode 100644 betterproto/tests/oneof.json create mode 100644 betterproto/tests/oneof.proto diff --git a/README.md b/README.md index 7fcde09..841a984 100644 --- a/README.md +++ b/README.md @@ -222,6 +222,10 @@ $ pipenv run tests - [x] Refs to nested types - [x] Imports in proto files - [x] Well-known Google types +- [ ] OneOf support + - [x] Basic support on the wire + - [ ] Check which was set from the group + - [ ] Setting one unsets the others - [ ] JSON that isn't completely naive. - [x] 64-bit ints as strings - [x] Maps diff --git a/betterproto/tests/oneof-name.json b/betterproto/tests/oneof-name.json new file mode 100644 index 0000000..bde99de --- /dev/null +++ b/betterproto/tests/oneof-name.json @@ -0,0 +1,3 @@ +{ + "name": "foo" +} diff --git a/betterproto/tests/oneof.json b/betterproto/tests/oneof.json new file mode 100644 index 0000000..400decb --- /dev/null +++ b/betterproto/tests/oneof.json @@ -0,0 +1,3 @@ +{ + "count": 1 +} diff --git a/betterproto/tests/oneof.proto b/betterproto/tests/oneof.proto new file mode 100644 index 0000000..693e5b5 --- /dev/null +++ b/betterproto/tests/oneof.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; + +message Test { + oneof foo { + int32 count = 1; + string name = 2; + } +}