-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test suite based on docs/serialization.md [changelog skip]
- Loading branch information
1 parent
396b921
commit 39e91ac
Showing
21 changed files
with
217 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
record foo ( | ||
int64 bar/baz, | ||
); |
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,4 @@ | ||
record Payload ( | ||
text FIELD_NAME, | ||
float64 second-field-name, | ||
); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"description": "enum", | ||
"type": "fixture.foo.gender", | ||
"input": "yeoseong", | ||
"normal": "yeoseong" | ||
} |
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,6 @@ | ||
{ | ||
"description": "enum", | ||
"type": "fixture.foo.gender", | ||
"input": "male", | ||
"normal": "male" | ||
} |
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,15 @@ | ||
FIXME: To follow a general principle of robustness, this test should be successful. | ||
{ | ||
"description": "All identifiers has to be normalized.", | ||
"type": "fixture.norm.payload", | ||
"input": { | ||
"_type": "payload", | ||
"FIELD_NAME": "FIELD_NAME becomes to field_name", | ||
"second-field-name": 3.14 | ||
}, | ||
"normal": { | ||
"_type": "payload", | ||
"field_name": "FIELD_NAME becomes to field_name", | ||
"second_field_name": 3.14 | ||
} | ||
} |
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,21 @@ | ||
{ | ||
"description": "Parse a map type.", | ||
"type": "fixture.foo.record-with-map", | ||
"input": { | ||
"_type": "record_with_map", | ||
"text_to_text": [ | ||
{"key": "a", "value": "foo"}, | ||
{"key": "b", "value": "bar"}, | ||
{"key": "c", "value": "baz"} | ||
] | ||
}, | ||
"normal": { | ||
"_type": "record_with_map", | ||
"text_to_text": [ | ||
{"key": "a", "value": "foo"}, | ||
{"key": "b", "value": "bar"}, | ||
{"key": "c", "value": "baz"} | ||
] | ||
}, | ||
"ignoreOrder": "$.text_to_text" | ||
} |
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,12 @@ | ||
{ | ||
"description": "Name can have behind name.", | ||
"type": "fixture.name.foo", | ||
"input": { | ||
"_type": "foo", | ||
"baz": 1 | ||
}, | ||
"normal": { | ||
"_type": "foo", | ||
"baz": 1 | ||
} | ||
} |
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,10 @@ | ||
{ | ||
"description": "Nirum date type is represented as RFC 3339 date in JSON.", | ||
"type": "fixture.types.date-list", | ||
"input": [ | ||
"2018-05-10" | ||
], | ||
"normal": [ | ||
"2018-05-10" | ||
] | ||
} |
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,13 @@ | ||
{ | ||
"description": "_type can be emitted.", | ||
"type": "fixture.foo.person", | ||
"input": { | ||
"first_name": "foo", | ||
"last_name": "bar" | ||
}, | ||
"normal": { | ||
"_type": "person", | ||
"first_name": "foo", | ||
"last_name": "bar" | ||
} | ||
} |
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,15 @@ | ||
{ | ||
"description": "Parse object has more fields than definition.", | ||
"type": "fixture.foo.person", | ||
"input": { | ||
"_type": "person", | ||
"first_name": "foo", | ||
"last_name": "bar", | ||
"extra": "some" | ||
}, | ||
"normal": { | ||
"_type": "person", | ||
"first_name": "foo", | ||
"last_name": "bar" | ||
} | ||
} |
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,11 @@ | ||
{ | ||
"description": "If optional field isn't given, it should treat value of optional field is null.", | ||
"type": "fixture.foo.record-with-optional-record-field", | ||
"input": { | ||
"_type": "record_with_optional_record_field" | ||
}, | ||
"normal": { | ||
"_type": "record_with_optional_record_field", | ||
"f": null | ||
} | ||
} |
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,12 @@ | ||
{ | ||
"description": "If a field is optional, it is ok to give null.", | ||
"type": "fixture.foo.record-with-optional-record-field", | ||
"input": { | ||
"_type": "record_with_optional_record_field", | ||
"f": null | ||
}, | ||
"normal": { | ||
"_type": "record_with_optional_record_field", | ||
"f": null | ||
} | ||
} |
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,35 @@ | ||
{ | ||
"description": "Parse a set of record.", | ||
"type": "fixture.foo.people", | ||
"input": { | ||
"_type": "people", | ||
"people": [ | ||
{ | ||
"_type": "person", | ||
"first_name": "John", | ||
"last_name": "Doe" | ||
}, | ||
{ | ||
"_type": "person", | ||
"first_name": "John", | ||
"last_name": "Smith" | ||
} | ||
] | ||
}, | ||
"normal": { | ||
"_type": "people", | ||
"people": [ | ||
{ | ||
"_type": "person", | ||
"first_name": "John", | ||
"last_name": "Doe" | ||
}, | ||
{ | ||
"_type": "person", | ||
"first_name": "John", | ||
"last_name": "Smith" | ||
} | ||
] | ||
}, | ||
"ignoreOrder": "$.people" | ||
} |
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,6 @@ | ||
{ | ||
"description": "If an unboxed type consists of a list type it also has to be represented in the same way to its inner type.", | ||
"type": "fixture.types.list-unboxed", | ||
"input": ["september", "april"], | ||
"normal": ["september", "april"] | ||
} |
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,7 @@ | ||
{ | ||
"description": "If an unboxed type consists of a set type it also has to be represented in the same way to its inner type.", | ||
"type": "fixture.types.enum-set-unboxed", | ||
"input": ["february", "september"], | ||
"normal": ["february", "september"], | ||
"ignoreOrder": "$" | ||
} |
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,13 @@ | ||
{ | ||
"description": "If optional field isn't given, it should treat value of optional field is null.", | ||
"type": "fixture.foo.optional-union", | ||
"input": { | ||
"_tag": "foo", | ||
"_type": "optional_union" | ||
}, | ||
"normal": { | ||
"_tag": "foo", | ||
"_type": "optional_union", | ||
"bar": null | ||
} | ||
} |
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 |
---|---|---|
|
@@ -15,6 +15,7 @@ skip_install = true | |
deps = | ||
six | ||
flake8 | ||
jsonpath-ng | ||
pytest | ||
py27: python-dateutil | ||
commands = | ||
|