-
Notifications
You must be signed in to change notification settings - Fork 2
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
Adding dotNotation property and test #48
Conversation
src/prop_tests/dotNotation_test.js
Outdated
var prop = props.dotNotation('n.p'), | ||
alg = new set.Algebra(prop), | ||
res = alg.has({'n.p': 'IL'}, {n:{p:'IL'}}); | ||
ok(res, "object with nested property is member of set using dotNotation"); |
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.
Was also looking for a way to test the unpredictable argument order handling. Tried an alg.has with the arguments reversed, and my comparator returns true in that case, but alg.has was still returning false. I'm guessing another 'default' prop was doing its own check and returning false.
Anyone have an idea how I could test that via an algebra operation?
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 probably should understand this, but I don't, what causes the argument order to be unpredictable?
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.
Looks good. Just have a couple of questions.
src/prop_tests/dotNotation_test.js
Outdated
*/ | ||
var prop = props.dotNotation('n.p'), | ||
alg = new set.Algebra(prop), | ||
res = alg.has({'n.p': 'IL'}, {n:{p:'IL'}}); |
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.
Should you include a test for more than 1 level of nesting like address.state.city
?
src/prop_tests/dotNotation_test.js
Outdated
var prop = props.dotNotation('n.p'), | ||
alg = new set.Algebra(prop), | ||
res = alg.has({'n.p': 'IL'}, {n:{p:'IL'}}); | ||
ok(res, "object with nested property is member of set using dotNotation"); |
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 probably should understand this, but I don't, what causes the argument order to be unpredictable?
…t whenever a provided value is undefined. Needed when comparing two dot notation sets. Added set equality and subset tests.
Resolves #47.