hr.t 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 2 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, write to the
  15. # Free Software Foundation, Inc.
  16. # 59 Temple Place, Suite 330
  17. # Boston, MA 02111-1307 USA
  18. require 't/test.pl';
  19. package OddMuse;
  20. use Test::More tests => 8;
  21. # without portrait-support
  22. # nothing
  23. update_page('hr', "one\n----\ntwo\n");
  24. test_page(get_page('hr'), 'one ---- two');
  25. # usemod only
  26. add_module('usemod.pl');
  27. update_page('hr', "one\n----\nthree\n");
  28. test_page(get_page('hr'),
  29. '<div class="content browse"><p>one </p><hr /><p>three</p></div>');
  30. remove_rule(\&UsemodRule);
  31. # headers only
  32. add_module('headers.pl');
  33. update_page('hr', "one\n----\ntwo\n");
  34. test_page(get_page('hr'),
  35. '<div class="content browse"><h3>one</h3><p>two</p></div>');
  36. update_page('hr', "one\n\n----\nthree\n");
  37. test_page(get_page('hr'),
  38. '<div class="content browse"><p>one</p><hr /><p>three</p></div>');
  39. remove_rule(\&HeadersRule);
  40. # with portrait support
  41. clear_pages();
  42. # just portrait-support
  43. add_module('portrait-support.pl');
  44. update_page('hr', "[new]one\n----\ntwo\n");
  45. test_page(get_page('hr'),
  46. '<div class="content browse"><div class="color one level0"><p>one </p></div><hr /><p>two</p></div>');
  47. # usemod and portrait-support
  48. add_module('usemod.pl');
  49. update_page('hr', "one\n----\nthree\n");
  50. test_page(get_page('hr'),
  51. '<div class="content browse"><p>one </p><hr /><p>three</p></div>');
  52. remove_rule(\&UsemodRule);
  53. # headers and portrait-support
  54. add_module('headers.pl');
  55. update_page('hr', "one\n----\ntwo\n");
  56. test_page(get_page('hr'), '<div class="content browse"><h3>one</h3><p>two</p></div>');
  57. update_page('hr', "one\n\n----\nthree\n");
  58. test_page(get_page('hr'), '<div class="content browse"><p>one</p><hr /><p>three</p></div>');