moin.t 2.6 KB

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