Commit Graph

27 Commits

Author SHA1 Message Date
Alex Schroeder
755010f619 rollback.t: Fix tests given $KeepDays default
As $KeepDays now defaults to 0, more changes are required to make these
tests work again.
2015-09-20 14:03:18 +02:00
Alex Schroeder
44c7102dd5 rollback.t: fix many tests
This is done by appending "$KeepDays = 14" to the config file whenever
it gets written. This restores the old behaviour and thus "fixes" the
tests.
2015-09-20 11:44:37 +02:00
Alex Schroeder
e25a621e6e Big changes to how diffs are generated
The original issue was that looking at all changes (action=rc all=1) the
resulting diff didn't always make sense if you clicked on the diff link.
It showed the difference between that revision and the current revision.
The PrintHtmlDiff sub was changed significantly to make it easier to
understand and to help fix this issue.

The drawback is that it now requires a new key in page and keep files:
lastmajorsummary. It goes with lastmajor and diff-major and records the
summary for that particular edit. As new changes will start recording
this new key, the change will slowly propagate in existing wikis.
Whenever you look at minor diffs, however, the existing summary key is
chosen. Plus, whenever you want to look at differences between
particular revisions, this is equivalent to looking at minor diffs. So
the only situation that is problematic is an edit history like the
following:

A - major change
B - major change (major diff, major summary, last major revision)
C - minor change

When looking at this page with diff=2, we want to show major diff, major
summary, last major revision. If B happened before this commit was
installed, the summary will be missing.
2015-09-06 14:32:36 +02:00
Alex Schroeder
aec340b401 rollback.t: add another 1s sleep
Trying to solve an issue: sometimes the test fails on Alex Daniel's
test server but never on Alex Schroeder's laptop. The output of Recent
Changes being tested has no rollback button for one of the page links.
Actually, the last six edits have no rollback button:

12:34 UTC (diff) MinorPage . . . . 127.0.0.1 – Rollback to 2015-09-01 12:34 UTC (minor)
12:34 UTC (diff) AnotherEvilPage . . . . 127.0.0.1 – Rollback to 2015-09-01 12:34 UTC (minor)
12:34 UTC (diff) OtherPage . . . . 127.0.0.1 – Rollback to 2015-09-01 12:34 UTC
12:34 UTC (diff) NicePage . . . . 127.0.0.1 – Rollback to 2015-09-01 12:34 UTC
12:34 UTC (diff) EvilPage . . . . 127.0.0.1 – Rollback to 2015-09-01 12:34 UTC
12:34 UTC (diff) MinorPage . . . . 127.0.0.1 – testerror (minor)

Note that this includes the "testerror" minor edit which is about to
be rolled back. Perhaps that's because this should hold in
RollbackPossible and it does not: $ts != $LastUpdate. $ts would be the
timestamp of the testerror edit and $LastUpdate would be the timestamp
of the rollback. I've added another 1s sleep between these two.
2015-09-02 13:41:12 +02:00
Alex Schroeder
2ddd13eea5 rollback.t: Remove duplicate lines. 2015-07-05 08:42:37 +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
ffc2a0b12f Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2014-09-10 22:59:36 +02:00
Alex Schroeder
90c632f4ab Avoid Save button for comments after rollback
If you clicked on the Save button after rolling pack a comment page, the
content of the comment page would be deleted.
2014-09-10 22:56: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
e9375974cb rollback.t: Get rid of stat
Using stat to get the last edit timestamp can lead to a failing test.
To be absolutely certain, use the timestamp stored in the page file.
As it stands, $Now is used for the timestamp in the page file but if
this is a new file (revision 1), then the index file gets rewritten
and its timestamp changes.
2014-06-22 23:11:35 +02:00
Alex Schroeder
ba2de753dd Rollback must roll back to minor changes as well. 2013-08-24 13:39:34 +02: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
d94abdc567 Test for extra [[rollback]] entries in RecentChanges. 2010-04-21 20:55:31 +00:00
Alex Schroeder
a06b68dd9b Upgrade to GPLv3. 2008-09-19 23:52:00 +00:00
Alex Schroeder
9729de351f Changed tests from a[@class="rollback"] to input[@type="submit"]. 2007-10-29 00:59:29 +00:00
Alex Schroeder
79d41b77b6 Added test to find a bug in single page rollbacks. 2007-10-06 13:26:22 +00:00
Alex Schroeder
d8f4f4533b More rollback tests. 2007-10-06 12:23:00 +00:00
Alex Schroeder
b0e59177af Test URL encoding. 2007-09-29 16:07:29 +00:00
Alex Schroeder
3f2fc131d9 Fix number of tests, added another clean_pages() between the new test
set and the old tests.
2007-01-20 01:19:17 +00:00
Alex Schroeder
8081c6bab9 Add tests for a rollback check. 2007-01-20 00:51:02 +00:00
Alex Schroeder
e9b7971daa updated copyright year 2007-01-12 02:00:44 +00:00
Alex Schroeder
b1d14aec27 Updated tests regarding placement of rollback link. 2007-01-11 12:07:06 +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
663b03d2a9 Removed diag messages. 2006-09-19 19:26:05 +00:00
Alex Schroeder
ab13f4828b Added some diagnostics because creating 25 pages takes so long. 2006-09-19 16:15:46 +00:00
Alex Schroeder
09140ea8d0 Moved tests here from ../test.pl 2006-09-19 16:06:46 +00:00