Skip to content
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

fix(test): much stronger contracts for setter spec and tests #975

Merged
merged 1 commit into from
Nov 17, 2016

Conversation

monperrus
Copy link
Collaborator

@monperrus monperrus commented Nov 14, 2016

New behavior: all setters are fail-safe: if they don't make sense on a certain type, they do nothing (instead of throwing an exception).

This is better because:

  • this is visible from the API doc thanks to annotation @UnsettableAnnotation
  • the client code is not polluted by defensive try/catch blocks

New testing strategy: we test all setters:

  • incl. those that take a list as argument (and we put one element in that list).
  • incl those that take a reference as argument

By doing this, we fix a couple of bugs a parent of references.

and also removed the duplicate ParentTest class.

@monperrus monperrus force-pushed the test-parent2 branch 3 times, most recently from 64e9b36 to 700141f Compare November 14, 2016 22:39
@monperrus monperrus changed the title fix(parent): much stronger contract for parent test [WIP] fix(parent): much stronger contract for parent test Nov 15, 2016
@monperrus monperrus changed the title [WIP] fix(parent): much stronger contract for parent test fix(test): much stronger contracts for setter spec and tests Nov 16, 2016
getExecutable().setType(type);
type.setParent(this);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null check after

getExecutable().setType(type);
type.setParent(this);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null check after

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants