Skip to content

Commit cfedcab

Browse files
committed
Add basic oneof tests
1 parent a33d92d commit cfedcab

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ $ pipenv run tests
222222
- [x] Refs to nested types
223223
- [x] Imports in proto files
224224
- [x] Well-known Google types
225+
- [ ] OneOf support
226+
- [x] Basic support on the wire
227+
- [ ] Check which was set from the group
228+
- [ ] Setting one unsets the others
225229
- [ ] JSON that isn't completely naive.
226230
- [x] 64-bit ints as strings
227231
- [x] Maps

betterproto/tests/oneof-name.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"name": "foo"
3+
}

betterproto/tests/oneof.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"count": 1
3+
}

betterproto/tests/oneof.proto

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
syntax = "proto3";
2+
3+
message Test {
4+
oneof foo {
5+
int32 count = 1;
6+
string name = 2;
7+
}
8+
}

0 commit comments

Comments
 (0)