-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: Add tests for default properties #611
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving assuming you address my concerns bellow :)
|
||
func TestQuerySimpleWithSomeDefaultValues(t *testing.T) { | ||
test := testUtils.QueryTestCase{ | ||
Description: "...", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: did you omit the description on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope I did not :)
- desc
// A document with nil fields should be returned. | ||
func TestQuerySimpleWithDefaultValue(t *testing.T) { | ||
test := testUtils.QueryTestCase{ | ||
Description: "...", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- desc
Docs: map[int][]string{ | ||
0: { | ||
`{ }`, | ||
}, | ||
}, | ||
Results: []map[string]interface{}{}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
though: The way I interpret this is that you add an empty object to the database which from the expected result tells me that an empty object will be discarded. Am I thinking about this right? Otherwise I would expect this to be the result:
{
"Name": nil,
"Email": nil,
"Age": nil,
"HeightM": nil,
"Verified": nil,
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct - there is a comment linked to an issue regarding this at the top of the test function.
5ccf755
to
8bec1ac
Compare
It is not true when a doc has been read, but when the whole span is complete
Need two string fields for an upcoming test case
8bec1ac
to
aad0efc
Compare
* Rename variable It is not true when a doc has been read, but when the whole span is complete * Add email field to simple test schema Need two string fields for an upcoming test case * Add tests for default properties
Resolves #412
Description
Adds tests for default properties. Had to change a few test cids when adding a new field to a test schema, as that affects them. Includes a failing/documentation test linked to an issue (also noted in issue).