File: matches_error_runtime.test

package info (click to toggle)
php-twig 3.20.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,940 kB
  • sloc: php: 23,320; makefile: 110; sh: 43
file content (8 lines) | stat: -rw-r--r-- 288 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
--TEST--
Twig supports the "matches" operator with a great error message
--TEMPLATE--
{{ 'foo' matches 1 + 2 }}
--DATA--
return []
--EXCEPTION--
Twig\Error\RuntimeError: Regexp "3" passed to "matches" is not valid: Delimiter must not be alphanumeric%sbackslash%sin "index.twig" at line 2