Jinja Compat Tests

Enabled engines

comparisons expression

Template

{% if 'Templates' ends with 's' %}
"Templates" ends with "s"
{% endif %}

(error) v1.10.1

Unused 'ends' at end of if expression.

(error) v2.8.0

expected token 'end of statement block', got 'ends'

(error) v3.0.6

Liquid error: Unknown operator ends

(error) v2.5.0

 [Line 1, Column 22]
  expected block end in if statement

(error) v1.4.2

Reserved keyword "with" attempted to be used as a variable.

v1.24.2

"Templates" ends with "s"

(error) v0.9.5

TypeError: Cannot read property 'forEach' of undefined
   
   
   
   
   
   
   

Template

{% if varX == varY %}
`varX` is equal to `varY`
{% endif %}

Data

{
  "varX": "Templates",
  "varY": "Templates"
}

v1.10.1


`varX` is equal to `varY`

v2.8.0


`varX` is equal to `varY`

v3.0.6


`varX` is equal to `varY`

v2.5.0


`varX` is equal to `varY`

v1.4.2


`varX` is equal to `varY`

v1.24.2

`varX` is equal to `varY`

v0.9.5

`varX` is equal to `varY`

Template

{% if 2 >= 1 %}
2 is greater than or equal to 1
{% endif %}

{% if 2 >= 1 %}
2 is greater than or equal to 2
{% endif %}

v1.10.1


2 is greater than or equal to 1



2 is greater than or equal to 2

v2.8.0


2 is greater than or equal to 1



2 is greater than or equal to 2

v3.0.6


2 is greater than or equal to 1



2 is greater than or equal to 2

v2.5.0


2 is greater than or equal to 1



2 is greater than or equal to 2

v1.4.2


2 is greater than or equal to 1



2 is greater than or equal to 2

v1.24.2

2 is greater than or equal to 1

2 is greater than or equal to 2

v0.9.5

2 is greater than or equal to 1

2 is greater than or equal to 2

Template

{% if 2 > 1 %}
2 is greater than 1
{% endif %}

v1.10.1


2 is greater than 1

v2.8.0


2 is greater than 1

v3.0.6


2 is greater than 1

v2.5.0


2 is greater than 1

v1.4.2


2 is greater than 1

v1.24.2

2 is greater than 1

v0.9.5

2 is greater than 1

Template

{% if 1 <= 2 %}
1 is less than or equal to 2
{% endif %}

{% if 1 <= 1 %}
1 is less than or equal to 1
{% endif %}

v1.10.1


1 is less than or equal to 2



1 is less than or equal to 1

v2.8.0


1 is less than or equal to 2



1 is less than or equal to 1

v3.0.6


1 is less than or equal to 2



1 is less than or equal to 1

v2.5.0


1 is less than or equal to 2



1 is less than or equal to 1

v1.4.2


1 is less than or equal to 2



1 is less than or equal to 1

v1.24.2

1 is less than or equal to 2

1 is less than or equal to 1

v0.9.5

1 is less than or equal to 2

1 is less than or equal to 1

Template

{% if 1 < 2 %}
1 is less than 2
{% endif %}

v1.10.1


1 is less than 2

v2.8.0


1 is less than 2

v3.0.6


1 is less than 2

v2.5.0


1 is less than 2

v1.4.2


1 is less than 2

v1.24.2

1 is less than 2

v0.9.5

1 is less than 2

Template

{% if phone matches '/^[\\d\\.]+$/' %}
`phone` is a valid phone number
{% endif %}

Data

{
  "phone": "00311234567"
}

(error) v1.10.1

Unused 'matches' at end of if expression.

(error) v2.8.0

expected token 'end of statement block', got 'matches'

(error) v3.0.6

Liquid error: Unknown operator matches

(error) v2.5.0

 [Line 1, Column 19]
  expected block end in if statement

(error) v1.4.2

SyntaxError: Unexpected string.

v1.24.2

`phone` is a valid phone number

(error) v0.9.5

TypeError: Cannot read property 'forEach' of undefined
   
   
   
   
   
   
   

Template

{% if varX != varY %}
`varX` is not equal to `varY`
{% endif %}

Data

{
  "varX": "Templates",
  "varY": "Partials"
}

v1.10.1


`varX` is not equal to `varY`

v2.8.0


`varX` is not equal to `varY`

v3.0.6


`varX` is not equal to `varY`

v2.5.0


`varX` is not equal to `varY`

v1.4.2


`varX` is not equal to `varY`

v1.24.2

`varX` is not equal to `varY`

v0.9.5

`varX` is not equal to `varY`

Template

{% if 'Templates' starts with 'T' %}
"Templates" starts with "T"
{% endif %}

(error) v1.10.1

Unused 'starts' at end of if expression.

(error) v2.8.0

expected token 'end of statement block', got 'starts'

(error) v3.0.6

Liquid error: Unknown operator starts

(error) v2.5.0

 [Line 1, Column 24]
  expected block end in if statement

(error) v1.4.2

Reserved keyword "with" attempted to be used as a variable.

v1.24.2

"Templates" starts with "T"

(error) v0.9.5

TypeError: Cannot read property 'forEach' of undefined
   
   
   
   
   
   
   

Template

{% if 1234 === 1234 %}
1234 not strict equal to 1234
{% endif %}

(error) v1.10.1

Could not parse the remainder: '===' from '==='

(error) v2.8.0

unexpected '='

(error) v3.0.6

Liquid error: Unknown operator ===

v2.5.0


1234 not strict equal to 1234

v1.4.2


1234 not strict equal to 1234

(error) v1.24.2

Unexpected token "operator" of value "=".

(error) v0.9.5

TypeError: Cannot read property 'forEach' of undefined
   
   
   
   
   
   
   

Template

{% if 1234 !== '1234' %}
1234 is not strict equal to '1234'
{% endif %}

(error) v1.10.1

Could not parse the remainder: '!==' from '!=='

(error) v2.8.0

unexpected '='

(error) v3.0.6

Liquid error: Unknown operator !==

v2.5.0


1234 is not strict equal to '1234'

v1.4.2


1234 is not strict equal to '1234'

(error) v1.24.2

Unexpected token "operator" of value "=".

(error) v0.9.5

TypeError: Cannot read property 'forEach' of undefined