Otera.Tests (otera v0.1.0)

Copy Markdown View Source

The builtin tests of Jinja2, such as x is defined or x is divisibleby 3, with their Python behavior.

The tests are boolean, callable, defined, divisibleby, escaped, even, false, filter, float, in, integer, iterable, lower, mapping, none, number, odd, sameas, sequence, string, test, true, undefined and upper, and the comparisons eq (equalto, ==), ne (!=), lt (lessthan, <), le (<=), gt (greaterthan, >) and ge (>=).

Summary

Functions

Returns true if name is a builtin test.

Applies the builtin test name to value. env gives the custom filters and tests for the filter and test tests.

Functions

builtin?(name)

@spec builtin?(String.t()) :: boolean()

Returns true if name is a builtin test.

call(name, value, args, kwargs, env)

@spec call(String.t(), term(), list(), Otera.Dict.t(), map()) :: boolean()

Applies the builtin test name to value. env gives the custom filters and tests for the filter and test tests.