aboutsummaryrefslogtreecommitdiff
path: root/tests/app
diff options
context:
space:
mode:
Diffstat (limited to 'tests/app')
-rw-r--r--tests/app/Models/SearchTest.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/app/Models/SearchTest.php b/tests/app/Models/SearchTest.php
index fad5d4768..213fdde45 100644
--- a/tests/app/Models/SearchTest.php
+++ b/tests/app/Models/SearchTest.php
@@ -790,6 +790,21 @@ final class SearchTest extends \PHPUnit\Framework\TestCase {
'((e.title LIKE ? OR e.content LIKE ?) )',
['%https://example.net/test/%', '%https://example.net/test/%']
],
+ [ // Regex with literal 'or'
+ 'intitle:/^A or B/i',
+ '(e.title ~* ? )',
+ ['^A or B']
+ ],
+ [ // Regex with literal 'OR'
+ 'intitle:/^A B OR C D/i OR intitle:/^A B OR C D/i',
+ '(e.title ~* ? ) OR (e.title ~* ? )',
+ ['^A B OR C D', '^A B OR C D']
+ ],
+ [ // Quote with literal 'OR'
+ 'intitle:"A B OR C D" OR intitle:"E or F"',
+ '(e.title LIKE ? ) OR (e.title LIKE ? )',
+ ['%A B OR C D%', '%E or F%']
+ ],
];
}
@@ -997,6 +1012,14 @@ final class SearchTest extends \PHPUnit\Framework\TestCase {
'-intitle:a -inurl:b',
'-intitle:a -inurl:b',
],
+ [
+ 'intitle:/^A or B/i',
+ 'intitle:/^A or B/i',
+ ],
+ [
+ 'intitle:/^A B OR C D/i',
+ 'intitle:/^A B OR C D/i',
+ ],
];
}