Commit Graph

27 Commits

Author SHA1 Message Date
Alex Schroeder
986e4fc65f Replace: no pagination
The old code would only call the the function provided
if pagination indicated that it was OK to do so. Thus,
only the first ten pages got replaced. This has been
fixed and tests have been added.
2015-12-16 15:50:35 +01:00
Alex Schroeder
a8b7b67efe Use warnings
search.t: Using braces without escaping them in regular expressions
trigges a warning. wiki.pl will now quotemeta the replacement string
when highlighting changes.

upgrade-files.t: Only remove the old UseMod directory if it actually
exists in order to fix some warnings.

wiki.pl: only reading the log file when open actually succeeded in order
to fix some warnings.
2015-10-12 15:12:20 +02:00
Alex Schroeder
9472a279ea Lots of tests for preview pagination 2015-09-12 00:05:30 +02:00
Alex Schroeder
57a4132512 Fix test for malformed regular expression search 2015-09-11 15:14:34 +02:00
Alex Schroeder
a602bc0678 search.t: test grouping of search terms 2015-08-16 09:23:33 +02:00
Alex Schroeder
ac7d68d134 search.t: do not test without $PATH
There is no need to test a fallback when grep is unavailable because we
got rid of $UseGrep.
2015-08-10 10:30:58 +02:00
Aleks-Daniel Jakimenko
eb3071d0db Removing clear_pages() from the beginning of tests (part 2)
This script was used:
perl -0pi -e 's/(use utf8[^\n]+)\n+clear_pages\(\);[^\n]*\n+/$1\n\n/' *.t
2015-07-05 03:32:04 +03:00
Alex Schroeder
01086ab8e0 search.t: test whether replacement field is shown
Only admins should see the Replace text field.
2015-03-07 08:52:02 +01:00
Alex Schroeder
fae5f1e345 replacements: fixed recently introduced bug
The recently introduced code to prevent Perl injection broke repeated
replacements with backreferences.
2015-01-25 09:06:22 +01:00
Alex Schroeder
81b179acac search: fixed handling of missing grep
When closing the pipe to grep, check the status returned by the child
process in $? and return all pages if there was an error (which means
that grep did not filter any pages).
2015-01-25 08:40:07 +01:00
Alex Schroeder
b7e2a04bb4 search.t: test fix for encoding error
On my website, I noticed that searching for matching pages with a
string containing a non-ascii character worked, where as doing a
normal search resulted in an encoding error. The difference was this:

  # fix match parameter
  my $match = GetParam('match', '');
  SetParam('match', FreeToNormal($match)) if $match;

This may be necessary to remove underscores, but it should not be
necessary to fix encoding errors.
2014-10-10 18:15:54 +02:00
Alex Jakimenko
f4e551111a Executable flag is only useful when shebang is specified 2014-09-03 14:23:20 +03:00
Alex Schroeder
67650e3dc8 More UTF-8 fixes
All the source files containing non-ASCII characters needed to have
utf8 added. This will be necessary for user config files as well! The
regular expressions identifying page names had to be changed.
UrlEncode translates the string back to bytes before encoding it.
Cached RSS files are saved with UTF-8 encoding and therefore need
their meta-data changed (using the XML::RSS module to do this
correctly didn't work for some of the test files). The CGI object's
parameters, keywords and info_path are decoded correctly. File access
uses the UTF-8 layer (reading, writing, appending, access to the log
of recent changes, running sub processes with grep and diff).

The mac compatibility extension will also disable the use of grep if
non-ASCII characters are searched for because of an unexplained
problem with grep.
2012-05-24 18:08:42 +02:00
Alex Schroeder
595574509d missing grep remains unreported 2010-04-21 21:37:53 +00:00
Alex Schroeder
34f2d66b37 Handle more filesystem encoding variants. 2010-04-21 21:20:23 +00:00
Alex Schroeder
77caec8e09 Add a test for broken regular expressions. 2009-08-19 16:18:34 +00:00
Alex Schroeder
0da7b5f8a9 Allow searching HTML entities 2009-07-01 07:56:59 +00:00
Alex Schroeder
70bc1e8617 Added a test that is marked as TODO for grep being unavailable. 2009-06-04 06:34:34 +00:00
Alex Schroeder
0ff9cae635 Search pagenames, too 2009-03-11 08:45:46 +00:00
Alex Schroeder
2230663358 Four more tests to test searching for "0". 2009-02-22 10:12:01 +00:00
Alex Schroeder
545f8bfc11 Changed license to GPL v3. 2007-08-15 14:34:53 +00:00
Alex Schroeder
75b734f3cb Added delete=1 to a test. 2007-08-15 14:33:06 +00:00
Alex Schroeder
b6af4cfaff Test replacements with the empty string. 2007-08-03 08:31:01 +00:00
Alex Schroeder
58e4172bbc Convert to Unix EOL.
Fix the reinitialization after the creation of InterMap pages.
2006-10-10 01:17:23 +00:00
Alex Schroeder
558af917a1 Added license. 2006-09-20 00:11:31 +00:00
Alex Schroeder
dfcb999f57 add double quotes around one of the tests. 2006-09-19 19:41:00 +00:00
Alex Schroeder
38504ac6ce Moved tests here from ../test.pl 2006-09-19 18:36:46 +00:00