Skip to content
This repository has been archived by the owner on Mar 18, 2021. It is now read-only.

Fixed bug with isNotPresent in partial matcher. #143

Merged
merged 3 commits into from
Nov 30, 2016
Merged

Conversation

anachlas
Copy link
Contributor

@anachlas anachlas commented Nov 29, 2016

Fixes #142

extra = [];
matchState["extra"] = extra;
if (matchValue is _NotPresentMatcher) {
if (value != null) {
Copy link
Contributor

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})));
Copy link
Contributor

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}

@@ -512,6 +512,33 @@ void main() {
expect(e.toString(), contains('Body: {"foo":"bar","x":5}'));
}
});

test("Partial match, null and not present", () async {
Copy link
Contributor

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}))

Copy link
Contributor Author

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.

@itsjoeconway itsjoeconway merged commit 48a9b78 into 1.0 Nov 30, 2016
@itsjoeconway itsjoeconway deleted the an/fixisnotpresent branch November 30, 2016 22:01
itsjoeconway pushed a commit that referenced this pull request Dec 1, 2016
* Fixed bug with isNotPresent in partial matcher.

* Added a test, caught another bug, fixed the bug.

* Check success case.
itsjoeconway added a commit that referenced this pull request Dec 7, 2016
* 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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants