mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-10-03 00:16:52 -04:00
On MySQL and MariaDB (the compressed content_bin code path, isCompressed() === true), three of the four regex-search constructions in FreshRSS_EntryDAO::sqlBooleanSearch() generated invalid SQL, so the query failed and the search silently returned zero articles: * intext:/regex/ appended a stray closing parenthesis after sqlRegex(...) (MySQL error 1248); * -intext:/regex/ had the same stray parenthesis; * -/regex/ emitted ' ANT NOT ' instead of ' AND NOT ' (MySQL error 1064). sqlRegex() already returns a self-contained, balanced expression (REGEXP_LIKE(expr, ?, 'flags') or expr REGEXP ?), so no extra parenthesis is needed, matching the uncompressed (SQLite / PostgreSQL) branches. The existing MySQL / MariaDB unit tests for intext:/regex/ had captured the buggy unbalanced SQL as their expected strings; they are corrected, and new cases are added for -intext:/regex/ and -/regex/ on both flavours. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
FreshRSS tests
See our documentation about running tests.
make test-all
See test.yml for the GitHub Actions automated tests.
See composer.json for the different tests and versions, to be run locally.
Details about this tests folder
Unit tests are based on PHPUnit. Here is an example of manual install:
cd ./tests/
wget -O phpunit.phar https://phar.phpunit.de/phpunit-10.phar
php phpunit.phar --bootstrap bootstrap.php
The shellchecks.sh script is used to safeguard shell scripts from common
shell script bugs and to ensure a consistent style.
It requires ShellCheck and shfmt.