gotobar.t 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # Copyright (C) 2014 Alex Schroeder <alex@gnu.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 => 17;
  18. use utf8;
  19. add_module('gotobar.pl');
  20. test_page(update_page('InterMap', q{
  21. Edit http://emacswiki.org/wiki?action=edit;id=%s
  22. Browse http://emacswiki.org/wiki/%s
  23. }, 0, 0, 1), 'Edit', 'Browse');
  24. test_page(update_page('GotoBar', q{
  25. [[Hauptseite]]
  26. [[Letzte Änderungen]]
  27. [Browse:SiteMap Emacs Wiki]
  28. [http://example.org/ Example]
  29. }), 'Hauptseite', 'Letzte Änderungen', 'Emacs Wiki', 'Example');
  30. test_page(get_page('Hauptseite'),
  31. 'Hauptseite', 'Letzte Änderungen', 'Emacs Wiki', 'Example');
  32. test_page(get_page('Letzte_%C3%84nderungen'),
  33. 'GotoBar');
  34. update_page('GotoBar', q{
  35. [[Comments on $id]]
  36. [[Comments on $id|Comments]]
  37. [[Edit:$id Edit $id]]
  38. [http://example.org/$$id Example]
  39. });
  40. test_page(get_page('Tëst'),
  41. 'Comments on Tëst', 'Comments_on_T%c3%abst',
  42. 'http://emacswiki.org/wiki\?action=edit;id=Tëst', 'Edit Tëst',
  43. 'http://example.org/T%c3%abst', 'Example');