moin.t 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 => 15;
  18. add_module('moin.pl');
  19. xpath_run_tests(split('\n',<<'EOT'));
  20. foo[[BR]]bar
  21. //text()[string()="foo"]/following-sibling::br/following-sibling::text()[string()="bar"]
  22. ''foo''
  23. //em[text()="foo"]
  24. '''bar'''
  25. //strong[text()="bar"]
  26. [[foo bar]]
  27. //a[@class="edit"][@title="Click to edit this page"][@href="http://localhost/test.pl?action=edit;id=foo_bar"][text()="?"]
  28. ["foo bar"]
  29. //a[@class="edit"][@title="Click to edit this page"][@href="http://localhost/test.pl?action=edit;id=foo_bar"][text()="?"]
  30. * one\n * two\n * two.one
  31. //ul/li[text()="one"]/following-sibling::li/text()[string()="two"]/following-sibling::ul/li[text()="two.one"]
  32. * one\n * one.one\n * two
  33. //ul/li/text()[string()="one"]/following-sibling::ul/li[text()="one.one"]/../../following-sibling::li[text()="two"]
  34. * one\n * one.one\n * two
  35. //ul/li/text()[string()="one"]/following-sibling::ul/li[text()="one.one"]/../../following-sibling::li[text()="two"]
  36. 1. one\n 1. two\n 1. two.one
  37. //ol/li[text()="one"]/following-sibling::li/text()[string()="two"]/following-sibling::ol/li[text()="two.one"]
  38. one\n one.one\n two
  39. //dl[@class="quote"]/dd/text()[normalize-space(string())="one"]/following-sibling::dl/dd[normalize-space(text())="one.one"]/../../following-sibling::dd[text()="two"]
  40. * one\n more\n * two\n more
  41. //ul/li[normalize-space(text())="one more"]/following-sibling::li[normalize-space(text())="two more"]
  42. * one\n more\n * two\n more
  43. //ul/li/text()[normalize-space(string())="one more"]/following-sibling::ul/li[normalize-space(text())="two more"]
  44. one\n more\n two\n more
  45. //dl[@class="quote"]/dd/text()[normalize-space(string())="one more"]/following-sibling::dl/dd[normalize-space(text())="two more"]
  46. {{{\n[[foo bar]]\n}}}
  47. //pre[@class="real"][text()="[[foo bar]]\n"]
  48. hello mum\nthis is for you...
  49. //div[text()="hello mum this is for you..."]
  50. EOT