xml_tests.t 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. use strict;
  2. use File::Spec;
  3. BEGIN { if (defined($ENV{'top_srcdir'})) {unshift @INC, File::Spec->catdir($ENV{'top_srcdir'}, 'tp');} }
  4. require 't/test_utils.pl';
  5. my @test_cases = (
  6. ['image_inline_or_not',
  7. '@image{A}
  8. Para @image{hh}.
  9. @node Top
  10. @top top
  11. @image{B}
  12. Para @image{jj}.
  13. @example
  14. @image{in_example}
  15. T
  16. @image{in example after text}
  17. @end example
  18. @quotation @image{in_quotation_arg}
  19. @image{in_quotation_content}
  20. @end quotation
  21. @table @asis
  22. @item @image{in_table_item}
  23. @image{in_table_def}
  24. AA @image{in_table_def_para}
  25. @image{in_table_def_after}
  26. @end table
  27. @menu
  28. * @image{node_image}:: @image{image_in_description}
  29. * @image{in_menu_entry_name}: (somewhere)@image{extnode}.
  30. @image{in_menu_comment}
  31. @end menu
  32. @node @image{node_image}
  33. @chapter @image{in_chapter_arg}
  34. T@footnote{
  35. @image{in_footnote}
  36. }
  37. @float F,g
  38. @image{in_float}
  39. @caption{@image{in_caption} PAra @image{in_caption_para}}
  40. @end float
  41. '],
  42. ['comments_on_block_command_lines',
  43. '@itemize @c comm
  44. @item itemize it
  45. @end itemize
  46. @itemize x @c comm
  47. @item itemize xit
  48. @end itemize
  49. @itemize @bullet @c comm
  50. @item itemize bulletit
  51. @end itemize
  52. @itemize @bullet{} @c comm
  53. @item itemize bullet with braces
  54. @end itemize
  55. @enumerate @c comm
  56. @item en
  57. @end enumerate
  58. @enumerate a @c comm
  59. @item aen
  60. @end enumerate
  61. @table @asis @c table
  62. @item it
  63. @end table
  64. @quotation @c quot no arg
  65. Quot no arg
  66. @end quotation
  67. @quotation quotarg @c quot arg
  68. Quot arg
  69. @end quotation
  70. @group @c comm
  71. in gr
  72. @end group
  73. @example @c comm
  74. in ex
  75. @end example
  76. @multitable @columnfractions 0.4 0.6 @c comm
  77. @item a @tab b
  78. @end multitable
  79. @multitable {aaa} {bbb} @c c
  80. @item aaa @tab bbb
  81. @end multitable
  82. @float f,g @c comm
  83. In f
  84. @end float
  85. @flushright @c comm
  86. flushright
  87. @end flushright
  88. @raggedright @c comm
  89. raggedright
  90. @end raggedright
  91. '],
  92. ['comments_end_lines',
  93. '@itemize
  94. @item itemize it
  95. @end itemize @c comment itemize
  96. @enumerate
  97. @end enumerate @c comm
  98. @table @asis
  99. @item it
  100. @end table @c table
  101. @quotation
  102. Quot no arg
  103. @end quotation @c quot no arg
  104. @group
  105. in gr
  106. @end group @c comm
  107. @example
  108. in ex
  109. @end example @c comm
  110. @multitable @columnfractions 0.4 0.6
  111. @item a @tab b
  112. @end multitable @c comm
  113. @float f,g
  114. In f
  115. @end float @c comm
  116. @flushright
  117. flushright
  118. @end flushright @c comm
  119. @raggedright
  120. raggedright
  121. @end raggedright @c comm
  122. '],
  123. ['comments_on_misc_command_line',
  124. '@setfilename comments_on_misc_command_line.info @c setfilename (text)
  125. @definfoenclose phoo,;,: @c definfoenclose (number)
  126. @firstparagraphindent none @c c (number)
  127. @raisesections @c raisesections (skipline)
  128. @insertcopying @comment (noarg)
  129. @pagesizes 200mm @c pagesizes (line)
  130. @everyheading @thispage @| aaa @c everyheading (lineraw)
  131. @indent @c indent (skipspace)
  132. Para.
  133. '],
  134. ['raw',
  135. '@tex
  136. in <tex>
  137. @end tex
  138. Para
  139. @xml
  140. <in />
  141. @end xml
  142. ',
  143. {'expanded_formats' => ['tex', 'xml']}
  144. ],
  145. ['raw_and_comments',
  146. '@tex @c comment
  147. in <tex>
  148. @end tex @comment other comment
  149. Para
  150. @xml @c in xml comment
  151. <in />
  152. @end xml @comment end xml comment
  153. ',
  154. {'expanded_formats' => ['tex', 'xml']}
  155. ],
  156. ['node_no_section',
  157. '@node Top
  158. '],
  159. ['macro_and_args',
  160. '@macro good { aaa, 2b-bb}
  161. @end macro
  162. @macro bad { ggg"@@^_ ff, nnn_b, ccc v}
  163. @end macro
  164. '],
  165. ['commands_and_spaces',
  166. '@set foo some @value
  167. @setfilename commands_and_spaces.info
  168. @unmacro ggg
  169. @clickstyle @arrow
  170. @cropmarks after cropmarks.
  171. @node a ,(b),(c) , (d)
  172. @center centered
  173. @indent after indent.
  174. @indent
  175. line after indent
  176. @indent
  177. endof line with spaces line after indent
  178. @image{ a ,b,c , d,e }
  179. @image{ a ,b
  180. ,c , d,e }
  181. @quotation Note
  182. Q
  183. @end quotation
  184. @float ff , b
  185. f
  186. @caption{ In caption }j.
  187. @shortcaption{Short} g.
  188. @end float
  189. @multitable @columnfractions 0.4 0.6
  190. @end multitable
  191. @multitable {aa b} { r } @var{cmd}gg hh j
  192. @end multitable
  193. @verbatim
  194. in verbatim @g
  195. @end verbatim
  196. @tex
  197. in tex
  198. @end tex
  199. @example
  200. in example
  201. @end example
  202. @table @strong
  203. @item in item
  204. @end table
  205. T@footnote{ a}.
  206. Math @math{ \\underline{ a, b} }.
  207. @indicateurl{ http://ggg }
  208. @deffn { truc } { machin } { bidule } { chose } { arg }
  209. T
  210. @end deffn
  211. ',
  212. {'expanded_formats' => ['tex'] }
  213. ],
  214. ['spaces_info_lost',
  215. '@example text on example line
  216. in bad example
  217. @end example
  218. @verbatim
  219. in verbatim @g
  220. @end verbatim
  221. '],
  222. ['brace_commands_spaces_end_of_lines',
  223. '@image{
  224. a}
  225. @image{
  226. a}
  227. @image{a,
  228. b}
  229. @image{a,
  230. b}
  231. @image{a,
  232. b}
  233. @image{a,
  234. b}
  235. '],
  236. ['node_and_bye',
  237. '@node Top
  238. @bye
  239. ', {'test_split' => 'section'}],
  240. ['lone_bye',
  241. '@bye
  242. '],
  243. );
  244. foreach my $test (@test_cases) {
  245. $test->[2]->{'test_formats'} = ['xml'];
  246. }
  247. our ($arg_test_case, $arg_generate, $arg_debug);
  248. run_all ('xml_tests', [@test_cases], $arg_test_case,
  249. $arg_generate, $arg_debug);
  250. 1;