hr.t 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Copyright (C) 2006 Alex Schroeder <alex@emacswiki.org>
  2. #
  3. # This program is free software; you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation; either version 3 of the License, or
  6. # (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. require './t/test.pl';
  16. package OddMuse;
  17. use Test::More tests => 8;
  18. # without portrait-support
  19. # nothing
  20. update_page('hr', "one\n----\ntwo\n");
  21. test_page(get_page('hr'), 'one ---- two');
  22. # usemod only
  23. add_module('usemod.pl');
  24. update_page('hr', "one\n----\nthree\n");
  25. test_page(get_page('hr'),
  26. '<div class="content browse" lang="en"><p>one </p><hr /><p>three</p></div>');
  27. remove_rule(\&UsemodRule);
  28. # headers only
  29. add_module('headers.pl');
  30. update_page('hr', "one\n----\ntwo\n");
  31. test_page(get_page('hr'),
  32. '<div class="content browse" lang="en"><h3>one</h3><p>two</p></div>');
  33. update_page('hr', "one\n\n----\nthree\n");
  34. test_page(get_page('hr'),
  35. '<div class="content browse" lang="en"><p>one</p><hr /><p>three</p></div>');
  36. remove_rule(\&HeadersRule);
  37. # with portrait support
  38. clear_pages();
  39. # just portrait-support
  40. add_module('portrait-support.pl');
  41. update_page('hr', "[new]one\n----\ntwo\n");
  42. test_page(get_page('hr'),
  43. '<div class="content browse" lang="en"><div class="color one level0"><p>one </p></div><hr /><p>two</p></div>');
  44. # usemod and portrait-support
  45. add_module('usemod.pl');
  46. update_page('hr', "one\n----\nthree\n");
  47. test_page(get_page('hr'),
  48. '<div class="content browse" lang="en"><p>one </p><hr /><p>three</p></div>');
  49. remove_rule(\&UsemodRule);
  50. # headers and portrait-support
  51. add_module('headers.pl');
  52. update_page('hr', "one\n----\ntwo\n");
  53. test_page(get_page('hr'), '<div class="content browse" lang="en"><h3>one</h3><p>two</p></div>');
  54. update_page('hr', "one\n\n----\nthree\n");
  55. test_page(get_page('hr'), '<div class="content browse" lang="en"><p>one</p><hr /><p>three</p></div>');