Skip to content

Add more sequence expression tests.#175

Merged
mattcoley merged 6 commits into
masterfrom
add-array-exptests
Feb 9, 2018
Merged

Add more sequence expression tests.#175
mattcoley merged 6 commits into
masterfrom
add-array-exptests

Conversation

@mattcoley

@mattcoley mattcoley commented Feb 8, 2018

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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
Copy Markdown
Collaborator Author

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


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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"containsall"?

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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