summary.t 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Copyright (C) 2006, 2007 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 => 11;
  18. update_page('link', 'some [http://example.com content]');
  19. update_page('long', q{This program is >>free<< software;
  20. you can redistribute it and/or modify it under the
  21. terms of the GNU General Public License as published
  22. by the Free Software Foundation; either version 2 of
  23. the License, or (at your option) any later version.});
  24. test_page(get_page('action=rc raw=1'),
  25. 'description: some content',
  26. "software; you",
  27. "the terms",
  28. "is >>free<< software",
  29. "Public License as \\. \\. \\.\n");
  30. test_page(get_page('action=rss'),
  31. "is &amp;gt;&amp;gt;free&amp;lt;&amp;lt; software");
  32. # second edit doesn't automatically set a summary
  33. update_page('link', 'fnord');
  34. test_page_negative(get_page('action=rc raw=1'),
  35. "description: some content",
  36. "description: fnord");
  37. # explicit setting of the summary works
  38. update_page('link', 'bonk', 'bunk');
  39. test_page(get_page('action=rc raw=1'),
  40. "description: bunk");
  41. # remove links from default summary when crossing $SummaryDefaultLength
  42. update_page('size', 'lirum larum fiderallala lirum larum fiderallala lirum larum fiderallala lirum larum fiderallala lirum larum fiderallala lirum [http://example.com content]');
  43. test_page_negative(get_page('action=rc raw=1'),
  44. 'content');
  45. update_page('link', 'fnord', '[[bunk]]');
  46. test_page(get_page('action=rc raw=1'),
  47. "description: bunk");