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

Add more sequence expression tests. #175

Merged
merged 6 commits into from
Feb 9, 2018
Merged

Add more sequence expression tests. #175

merged 6 commits into from
Feb 9, 2018

Conversation

mattcoley
Copy link
Collaborator

@mattcoley mattcoley commented Feb 8, 2018

Right now it is difficult to use selectattr or if val is for set functions. This adds three new expression tests: containing, containingall, and within.

  • containing: if the sequence contains an element. if [1, 2, 3] is containing 2).
  • containingall, if the sequence contains all elements of another sequence. if [1, 2, 3] is containingall [1, 2].
  • within: if a value is in a sequence of elements. if 1 is within [1, 2, 3]).

@mattcoley mattcoley requested a review from boulter February 8, 2018 20:03
@mattcoley
Copy link
Collaborator Author

We have no unit tests right now for these expression tests. Maybe I should just bite the bullet and write all of them? @boulter ?

@mattcoley
Copy link
Collaborator Author

Ok @boulter tests are added for these new expression tests.


@Override
public String getName() {
return "containingall";
Copy link
Contributor

Choose a reason for hiding this comment

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

"containsall"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It doesn't make grammatical sense. The syntax is if val is expTest val2. So that would be if val is containsall val2.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Whereas is containing, is containingall, and is within are the best verbs I have thought of.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Or we could reserve the keyword does and do if val1 does contain val2 :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

But that seems like overkill.

@mattcoley mattcoley merged commit 1815705 into master Feb 9, 2018
@mattcoley mattcoley deleted the add-array-exptests branch February 9, 2018 18:02
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