Skip to content

Negated expressions#187

Merged
boulter merged 5 commits into
masterfrom
negated-expressions
Apr 17, 2018
Merged

Negated expressions#187
boulter merged 5 commits into
masterfrom
negated-expressions

Conversation

@boulter

@boulter boulter commented Apr 17, 2018

Copy link
Copy Markdown
Contributor

Adds support for "not" as a prefix for expression tests such as

{% if variable is not defined %}

Fixes #180

@boulter boulter requested review from mattcoley and pfarrel April 17, 2018 15:51

@Test
public void itNegatesContaining() {
assertThat(jinjava.render(String.format(CONTAINING_TEMPLATE, "[1, 2, 3]", "4"), new HashMap<>())).isEqualTo("pass");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we have a test that evaluates to fail to make sure that this statement doesn't always evaluate to true.

@mattcoley mattcoley left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM but perhaps one more test?

@boulter boulter merged commit c00c9c4 into master Apr 17, 2018
@boulter boulter deleted the negated-expressions branch April 17, 2018 21:29
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.

Error parsing 'is not defined'

3 participants