-
Notifications
You must be signed in to change notification settings - Fork 278
Fixed bug with isNotPresent in partial matcher. #143
Conversation
extra = []; | ||
matchState["extra"] = extra; | ||
if (matchValue is _NotPresentMatcher) { | ||
if (value != null) { |
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.
check that item.containsKey(matchKey) == false
@@ -492,6 +492,7 @@ void main() { | |||
var response = await defaultTestClient.request("/foo").get(); | |||
expect(response, hasBody(partial({"foo": "bar"}))); | |||
expect(response, hasBody(partial({"x": greaterThan(0)}))); | |||
expect(response, hasBody(partial({"baz": isNotPresent}))); |
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.
split into own test, add test for map that contains {"key" : null}
23fbb4f
to
12934be
Compare
ce9b9ab
to
ba5e1ca
Compare
@@ -512,6 +512,33 @@ void main() { | |||
expect(e.toString(), contains('Body: {"foo":"bar","x":5}')); | |||
} | |||
}); | |||
|
|||
test("Partial match, null and not present", () async { |
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.
Is there a success case as well? expect(response, hasBody(partial({"abcd" : isNotPresent}))
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.
I had it in the other test and I took it out. One sec.
* Fixed bug with isNotPresent in partial matcher. * Added a test, caught another bug, fixed the bug. * Check success case.
* Fixing contentType behavior for Response * Fix tests to use content-type * Changing behavior for content type interpretation/handling for Response * Fixed documentation * Fixed docs, fixed style thing * dartfmt * Bump version number, change log * WIP; clean up private/public * Updated test/template projects to use import instead of part, changed data model builder to include lib dependencies * Cleaning up template project * Cleaned up API a bit, hid some things * Moved isolate exception back to public to prevent from breaking existing code, marked as deprecated * dartfmt * Fixed type on app config * Cleaned up example requestsink a smidgen * Revert "Cleaned up example requestsink a smidgen" This reverts commit 6255e4d. * Fixing small thing in template sink * Renaming some things * Made a few static values const * Fixing up some tests, test_all generator * Updated some tests, made the last managedcontext the default context * Removed unused method * Added instructions for running tests and collecting coverage * UPdated change log * Using codecov and adding to travis * Update CHANGELOG.md * Fixed bug with isNotPresent in partial matcher. (#143) * Fixed bug with isNotPresent in partial matcher. * Added a test, caught another bug, fixed the bug. * Check success case. * pr feedback * Jc/fix managed resolution (#147) * Tests and fixes for template generation and data model generation * Fixed some exit code stuff * Updated changelog * dartfmt * Removed unused imports * Jc/explicit query values (#148) * Tests and fixes for template generation and data model generation * Fixed some exit code stuff * dartfmt * Removed unused imports * Disallow multiple query parameters of same key if arg type is not List in HTTPController, allow when is * dartfmt * update changelog * Improve willSendResponse and tests * Fixing some naming and ordering in template (#150) * Fixing some naming and ordering in template * Fixed test issue with 1.21
Fixes #142