forked from github/kensanata.oddmuse
The recent changes in commit 62d6dc4b—fixing the summary for last major revisions—resulted in some changes in the output. These changes seem to be OK so I removed the tests for the old output. Basically, the tests created a new page using a minor change. What should the output be when browsing the page with diff=1? "No diff available" is correct. There is no need to mention the last major change because there is none. The next tests edited the same page using minor changes. What should the output be when browsing the page with diff=1? "No diff available" is still correct. There is still no need to mention the last major change because there is none.
57 lines
3.0 KiB
Perl
57 lines
3.0 KiB
Perl
# Copyright (C) 2006–2015 Alex Schroeder <alex@gnu.org>
|
||
#
|
||
# This program is free software; you can redistribute it and/or modify
|
||
# it under the terms of the GNU General Public License as published by
|
||
# the Free Software Foundation; either version 3 of the License, or
|
||
# (at your option) any later version.
|
||
#
|
||
# This program is distributed in the hope that it will be useful,
|
||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
# GNU General Public License for more details.
|
||
#
|
||
# You should have received a copy of the GNU General Public License
|
||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
||
require 't/test.pl';
|
||
package OddMuse;
|
||
use Test::More tests => 60;
|
||
|
||
# start with minor
|
||
update_page('bar', 'one', '', 1); # lastmajor is undef
|
||
test_page(get_page('action=browse id=bar diff=1'), 'No diff available', 'one');
|
||
test_page(get_page('action=browse id=bar diff=2'), 'No diff available', 'one', 'Last edit');
|
||
update_page('bar', 'two', '', 1); # lastmajor is undef
|
||
test_page(get_page('action=browse id=bar diff=1'), 'No diff available', 'two');
|
||
test_page(get_page('action=browse id=bar diff=2'), 'one', 'two', 'Last edit');
|
||
update_page('bar', 'three'); # lastmajor is 3
|
||
test_page(get_page('action=browse id=bar diff=1'), 'two', 'three', 'Last edit');
|
||
test_page(get_page('action=browse id=bar diff=2'), 'two', 'three', 'Last edit');
|
||
update_page('bar', 'four'); # lastmajor is 4
|
||
test_page(get_page('action=browse id=bar diff=1'), 'three', 'four', 'Last edit');
|
||
test_page(get_page('action=browse id=bar diff=2'), 'three', 'four', 'Last edit');
|
||
# start with major
|
||
|
||
clear_pages();
|
||
|
||
update_page('bla', 'one'); # lastmajor is 1
|
||
test_page(get_page('action=browse id=bla diff=1'), 'No diff available', 'one', 'Last edit');
|
||
test_page(get_page('action=browse id=bla diff=2'), 'No diff available', 'one', 'Last edit');
|
||
update_page('bla', 'two', '', 1); # lastmajor is 1
|
||
test_page(get_page('action=browse id=bla diff=1'), 'No diff available', 'two', 'Last major edit',
|
||
'diff=1;id=bla;diffrevision=1');
|
||
test_page(get_page('action=browse id=bla diff=2'), 'one', 'two', 'Last edit');
|
||
update_page('bla', 'three'); # lastmajor is 3
|
||
test_page(get_page('action=browse id=bla diff=1'), 'two', 'three', 'Last edit');
|
||
test_page(get_page('action=browse id=bla diff=2'), 'two', 'three', 'Last edit');
|
||
update_page('bla', 'four', '', 1); # lastmajor is 3
|
||
test_page(get_page('action=browse id=bla diff=1'), 'two', 'three', 'Last major edit',
|
||
'diff=1;id=bla;diffrevision=3');
|
||
test_page(get_page('action=browse id=bla diff=2'), 'three', 'four', 'Last edit');
|
||
update_page('bla', 'five'); # lastmajor is 5
|
||
test_page(get_page('action=browse id=bla diff=1'), 'four', 'five', 'Last edit');
|
||
test_page(get_page('action=browse id=bla diff=2'), 'four', 'five', 'Last edit');
|
||
update_page('bla', 'six'); # lastmajor is 6
|
||
test_page(get_page('action=browse id=bla diff=1'), 'five', 'six', 'Last edit');
|
||
test_page(get_page('action=browse id=bla diff=2'), 'five', 'six', 'Last edit');
|