alef 0.115.5

Opinionated polyglot binding generator for Rust libraries
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{% if needs_literal_comment|default(false) %}
  # ~keep Fixture expectations are literal data, not shell expressions.
  # shellcheck disable=SC2016
{% endif %}
{% if kind == "equals" %}
  [[ "${{ actual }}" == {{ expected }} ]]
{% elif kind == "contains" %}
  [[ "${{ actual }}" == *{{ expected }}* ]]
{% elif kind == "not_contains" %}
  [[ "${{ actual }}" != *{{ expected }}* ]]
{% elif kind == "not_empty" %}
  [[ -n "${{ actual }}" && "${{ actual }}" != null && "${{ actual }}" != '[]' && "${{ actual }}" != '{}' ]]
{% elif kind == "is_empty" %}
  [[ -z "${{ actual }}" ]]
{% else %}
  jq -en --arg actual "${{ actual }}" --arg expected {{ expected }} '($actual | tonumber) {{ operator }} ($expected | tonumber)' >/dev/null
{% endif %}