Skip to content

Commit

Permalink
Remove reserved keyword in Dart (#276)
Browse files Browse the repository at this point in the history
* change reserved keyword enum to status in test schema

* Fix tests

---------

Co-authored-by: Austin Milt <austin.w.milt@gmail.com>
  • Loading branch information
VojtechVitek and austinmilt committed Apr 9, 2024
1 parent d139a28 commit 71e3749
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion tests/_testdata/test.golden.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"type": "User"
},
{
"name": "enum",
"name": "status",
"type": "Status"
}
]
Expand Down
6 changes: 3 additions & 3 deletions tests/client/client.gen.go

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

8 changes: 4 additions & 4 deletions tests/schema/test.debug.gen.txt
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@
(*schema.TypeField)({
Comments: ([]string) {
},
Name: (string) (len=4) "enum",
Name: (string) (len=6) "status",
Type: (*schema.VarType)({
Expr: (string) (len=6) "Status",
Type: (schema.CoreType) 21,
Expand Down Expand Up @@ -2128,7 +2128,7 @@
(*schema.TypeField)({
Comments: ([]string) {
},
Name: (string) (len=4) "enum",
Name: (string) (len=6) "status",
Type: (*schema.VarType)({
Expr: (string) (len=6) "Status",
Type: (schema.CoreType) 21,
Expand Down Expand Up @@ -2775,7 +2775,7 @@
(*schema.TypeField)({
Comments: ([]string) {
},
Name: (string) (len=4) "enum",
Name: (string) (len=6) "status",
Type: (*schema.VarType)({
Expr: (string) (len=6) "Status",
Type: (schema.CoreType) 21,
Expand Down Expand Up @@ -2900,7 +2900,7 @@
},
Deprecated_Messages: ([]interface {}) <nil>
}),
SchemaHash: (string) (len=40) "1e00d2fe909b6626e4156ac2a40ff08223d75224",
SchemaHash: (string) (len=40) "59843169c5648f7290858df111734e016be54102",
WebrpcGenCommand: (string) (len=84) "webrpc-gen -schema=./schema/test.ridl -target=debug -out=./schema/test.debug.gen.txt",
WebrpcTarget: (string) (len=5) "debug",
WebrpcErrors: ([]*schema.Error) (len=11 cap=11) {
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/test.gen.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"type": "User"
},
{
"name": "enum",
"name": "status",
"type": "Status"
}
]
Expand Down
2 changes: 1 addition & 1 deletion tests/schema/test.ridl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct Complex
- listOfUsers: []User
- mapOfUsers: map<string,User>
- user: User
- enum: Status
- status: Status

error 1 Unauthorized "unauthorized" HTTP 401
error 2 ExpiredToken "expired token" HTTP 401
Expand Down
2 changes: 1 addition & 1 deletion tests/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ func TestRIDLSchemaAgainstJSON(t *testing.T) {

if !cmp.Equal(golden, current) {
t.Error(cmp.Diff(golden, current))
t.Log("To update the golden file, run go test -update=./_testdata/test.golden.json")
t.Log("To update the golden file, run `go test ./tests -update=./_testdata/test.golden.json'")
}
}
6 changes: 3 additions & 3 deletions tests/server/server.gen.go

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

2 changes: 1 addition & 1 deletion tests/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ var (
ListOfUsers: listOfUsers,
MapOfUsers: mapOfUsers,
User: user,
Enum: Status_AVAILABLE,
Status: Status_AVAILABLE,
}
)

Expand Down

0 comments on commit 71e3749

Please sign in to comment.