converters_tests.t 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063
  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 $accents_text = '@node Top
  6. @top top
  7. should be e`: @`{e} @`e
  8. should be e\': @\'{e} @\'e
  9. should be e^: @^{e} @^e
  10. should be u": @"{u} @"u
  11. should be i`: @`{i} @`i
  12. should be i\': @\'{i} @\'i
  13. should be i^: @^{i} @^i
  14. should be u": @"{u} @"u
  15. should be c,: @,{c} @,c
  16. should be n~: @~{n} @~n
  17. should be e=: @={e} @=e
  18. should be e@w{\'}\': @H{e} @H e
  19. should be e.: @dotaccent{e} @dotaccent e
  20. should be e*: @ringaccent{e} @ringaccent e
  21. should be ee[: @tieaccent{ee}
  22. should be e(: @u{e} @u e
  23. should be e_: @ubaraccent{e} @ubaraccent e
  24. should be .e: @udotaccent{e} @udotaccent e
  25. should be e<: @v{e} @v e
  26. should be a; : @ogonek{a} @ogonek a
  27. should be e; : @ogonek{e} @ogonek e
  28. upside down: @questiondown{} @exclamdown{}
  29. A-with-circle: @aa{},@AA{}
  30. AE, OE ligatures: @ae{} @AE{} @oe{} @OE{}
  31. dotless i, j: @dotless{i} @dotless{j}
  32. Polish suppressed-L: @l{} @L{}
  33. O-with-slash: @o{} @O{}
  34. es-zet or sharp S: @ss{}
  35. pounds sterling: @pounds{}
  36. @c arg is command -- @dotless{i} is special-cased for HTML
  37. should be dotless i`: @`{@dotless{i}}
  38. should be dotless i\': @\'{@dotless{i}}
  39. should be dotless i^: @^{@dotless{i}}
  40. should be dotless i": @"{@dotless{i}}
  41. @c arg is command -- @dotless{j}
  42. should be dotless j`: @`{@dotless{j}}
  43. should be dotless j\': @\'{@dotless{j}}
  44. should be dotless j^: @^{@dotless{j}}
  45. should be dotless j": @"{@dotless{j}}
  46. ';
  47. my $latin1_accents_text = '@documentencoding ISO-8859-1
  48. '.$accents_text;
  49. my $weird_accents_text = '@documentencoding ISO-8859-1
  50. @node Top
  51. @top top
  52. @={@~{@dotless{i}}}
  53. @={@,{@~{n}}}
  54. @={@ubaraccent{a}}
  55. @^{@udotaccent{@`r}}
  56. @={@\'{@`{r}}}
  57. ';
  58. my $inline_text = '
  59. @inlinefmt{html, <blink>html</blink> ``},
  60. @inlinefmt{plaintext, plaintext ``},
  61. @inlinefmt{xml, <para>xml</para> ``},
  62. @inlinefmt{docbook, <emphasis>docbook</emphasis> ``},
  63. @inlinefmt{tex, $\underline{a < b @code{tex \hbox{ code }}}$ ``}
  64. @inlineraw{html, raw <blink>html</blink> ``},
  65. @inlineraw{plaintext, raw plaintext ``},
  66. @inlineraw{xml, raw <para>xml</para> ``},
  67. @inlineraw{docbook, raw <emphasis>docbook</emphasis> ``},
  68. @inlineraw{tex, raw $\underline{a < b @code{tex \hbox{ code }}}$ ``}
  69. ';
  70. my $raw_commands_text = '
  71. @html
  72. <blink>html</blink> ``}
  73. @end html
  74. @xml
  75. <para>xml</para> ``}
  76. @end xml
  77. @docbook
  78. <emphasis>docbook</emphasis> ``}
  79. @end docbook
  80. @tex
  81. $\underline{a < b @code{tex \hbox{ code }}}$ ``}
  82. @end tex
  83. ';
  84. my $top_in_ref_text =
  85. '@node Top
  86. @code{@@ref@{Top,cross ref name@}} @ref{Top,cross ref name}
  87. @code{@@ref@{Top,,title@}} @ref{Top,,title}
  88. @code{@@ref@{Top,,,file name@}} @ref{Top,,,file name}
  89. @code{@@ref@{Top,,,,manual@}} @ref{Top,,,,manual}
  90. @code{@@ref@{Top,cross ref name,title,@}} @ref{Top,cross ref name,title,}
  91. @code{@@ref@{Top,cross ref name,,file name@}} @ref{Top,cross ref name,,file name}
  92. @code{@@ref@{Top,cross ref name,,,manual@}} @ref{Top,cross ref name,,,manual}
  93. @code{@@ref@{Top,cross ref name,title,file name@}} @ref{Top,cross ref name,title,file name}
  94. @code{@@ref@{Top,cross ref name,title,,manual@}} @ref{Top,cross ref name,title,,manual}
  95. @code{@@ref@{Top,cross ref name,title, file name, manual@}} @ref{Top,cross ref name,title, file name, manual}
  96. @code{@@ref@{Top,,title,file name@}} @ref{Top,,title,file name}
  97. @code{@@ref@{Top,,title,,manual@}} @ref{Top,,title,,manual}
  98. @code{@@ref@{Top,,title, file name, manual@}} @ref{Top,,title, file name, manual}
  99. @code{@@ref@{Top,,,file name,manual@}} @ref{Top,,,file name,manual}
  100. @code{@@ref@{(pman)Top,cross ref name@}} @ref{(pman)Top,cross ref name}
  101. @code{@@ref@{(pman)Top,,title@}} @ref{(pman)Top,,title}
  102. @code{@@ref@{(pman)Top,,,file name@}} @ref{(pman)Top,,,file name}
  103. @code{@@ref@{(pman)Top,,,,manual@}} @ref{(pman)Top,,,,manual}
  104. @code{@@ref@{(pman)Top,cross ref name,title,@}} @ref{(pman)Top,cross ref name,title,}
  105. @code{@@ref@{(pman)Top,cross ref name,,file name@}} @ref{(pman)Top,cross ref name,,file name}
  106. @code{@@ref@{(pman)Top,cross ref name,,,manual@}} @ref{(pman)Top,cross ref name,,,manual}
  107. @code{@@ref@{(pman)Top,cross ref name,title,file name@}} @ref{(pman)Top,cross ref name,title,file name}
  108. @code{@@ref@{(pman)Top,cross ref name,title,,manual@}} @ref{(pman)Top,cross ref name,title,,manual}
  109. @code{@@ref@{(pman)Top,cross ref name,title, file name, manual@}} @ref{(pman)Top,cross ref name,title, file name, manual}
  110. @code{@@ref@{(pman)Top,,title,file name@}} @ref{(pman)Top,,title,file name}
  111. @code{@@ref@{(pman)Top,,title,,manual@}} @ref{(pman)Top,,title,,manual}
  112. @code{@@ref@{(pman)Top,,title, file name, manual@}} @ref{(pman)Top,,title, file name, manual}
  113. @code{@@ref@{(pman)Top,,,file name,manual@}} @ref{(pman)Top,,,file name,manual}
  114. @code{@@inforef@{Top, cross ref name, file name@}} @inforef{Top, cross ref name, file name}
  115. @code{@@inforef@{Top@}} @inforef{Top}
  116. @code{@@inforef@{Top, cross ref name@}} @inforef{Top, cross ref name}
  117. @code{@@inforef@{Top,,file name@}} @inforef{Top,,file name}
  118. ';
  119. my $at_commands_in_refs_text = '@node Top
  120. @top Top
  121. @menu
  122. * @- @{ @}::
  123. * @ @ @! @* @. @: .@: @? @@::
  124. * @atchar{} @lbracechar{} @rbracechar{} @backslashchar{} @hashchar{}::
  125. * @LaTeX{} @TeX{} @bullet{} @comma{} @copyright{} @dots{} @enddots{}::
  126. * @equiv{} @error{} @euro{} @exclamdown{} @expansion{} @minus{}::
  127. * @geq{} @leq{} @arrow{}::
  128. * @ordf{} @ordm{} @point{} @pounds{} @print{} @questiondown{} @registeredsymbol{}::
  129. * @result{} @textdegree{} a@tie{}b @today{} @aa{}::
  130. * @AA{} @ae{} @oe{} @AE{} @OE{} @o{} @O{} @ss{} @l{} @L{} @DH{} @dh{} @TH{} @th{}::
  131. * @"{a} @~{e} @^{@dotless{i}} @^{a} @`{a} @\'e @,{c} @={e} @ringaccent{e} @H{e} @ogonek{e}::
  132. * @dotaccent{e} @u{e} @ubaraccent{e} @udotaccent{e} @v{e} @dotless{j} @tieaccent{ee}::
  133. * @dotless{i} @`{@=E} @,{@\'C}::
  134. * @quotedblleft{} @quotedblright{} @quoteleft{} @quoteright{} @quotedblbase{} @quotesinglbase{}::
  135. * @guillemetleft{} @guillemetright{} @guillemotleft{} @guillemotright{} @guilsinglleft{} @guilsinglright{}::
  136. * `` \'\' --- -- ` \'::
  137. * @acronym{AAA, fff} @acronym{AAA} @acronym{BBB}::
  138. * @abbr{CCC, rrr} @abbr{CCC} @abbr{DDD}::
  139. * @email{someone@@somewher, the someone} @email{no_explain@@there}::
  140. * @image{f--ile1} @image{f--ile,aze,az,alt,e--xt}::
  141. * @verb{. @ {} . .}::
  142. * @cite{cite @asis{asis}} @w{in @@w @b{b}} @r{in r} @sc{sc} @strong{str} @t{t} @var{var} @dfn{dfn} @i{i}::
  143. * @env{env} @code{code} @option{option} @samp{samp} @command{command} @file{file} @kbd{C-x @key{ESC}}::
  144. * 8.27@dmn{in}::
  145. * @sansserif{sansserif} @slanted{slanted}::
  146. * @indicateurl{indicateurl}::
  147. * @sub{g}H 3@sup{rd}::
  148. * @url{http://somewhere_aaa} @url{url, text} @uref{/man.cgi/1/ls,,ls}::
  149. @end menu
  150. @node @- @{ @}
  151. @chapter @- @{ @}
  152. @node @ @ @! @* @. @: .@: @? @@
  153. @chapter @ @ @! @* @. @: .@: @? @@
  154. @node @atchar{} @lbracechar{} @rbracechar{} @backslashchar{} @hashchar{}
  155. @chapter @atchar{} @lbracechar{} @rbracechar{} @backslashchar{} @hashchar{}
  156. @node @LaTeX{} @TeX{} @bullet{} @comma{} @copyright{} @dots{} @enddots{}
  157. @chapter @LaTeX{} @TeX{} @bullet{} @comma{} @copyright{} @dots{} @enddots{}
  158. @node @equiv{} @error{} @euro{} @exclamdown{} @expansion{} @minus{}
  159. @chapter @equiv{} @error{} @euro{} @exclamdown{} @expansion{} @minus{}
  160. @node @geq{} @leq{} @arrow{}
  161. @chapter @geq{} @leq{} @arrow{}
  162. @node @ordf{} @ordm{} @point{} @pounds{} @print{} @questiondown{} @registeredsymbol{}
  163. @chapter @ordf{} @ordm{} @point{} @pounds{} @print{} @questiondown{} @registeredsymbol{}
  164. @node @result{} @textdegree{} a@tie{}b @today{} @aa{}
  165. @chapter @result{} @textdegree{} a@tie{}b @today{} @aa{}
  166. @node @AA{} @ae{} @oe{} @AE{} @OE{} @o{} @O{} @ss{} @l{} @L{} @DH{} @dh{} @TH{} @th{}
  167. @chapter @AA{} @ae{} @oe{} @AE{} @OE{} @o{} @O{} @ss{} @l{} @L{} @DH{} @dh{} @TH{} @th{}
  168. @node @"{a} @~{e} @^{@dotless{i}} @^{a} @`{a} @\'e @,{c} @={e} @ringaccent{e} @H{e} @ogonek{e}
  169. @chapter @"{a} @~{e} @^{@dotless{i}} @^{a} @`{a} @\'e @,{c} @={e} @ringaccent{e} @H{e} @ogonek{e}
  170. @node @dotaccent{e} @u{e} @ubaraccent{e} @udotaccent{e} @v{e} @dotless{j} @tieaccent{ee}
  171. @chapter @dotaccent{e} @u{e} @ubaraccent{e} @udotaccent{e} @v{e} @dotless{j} @tieaccent{ee}
  172. @node @dotless{i} @`{@=E} @,{@\'C}
  173. @chapter @dotless{i} @`{@=E} @,{@\'C}
  174. @node @quotedblleft{} @quotedblright{} @quoteleft{} @quoteright{} @quotedblbase{} @quotesinglbase{}
  175. @chapter @quotedblleft{} @quotedblright{} @quoteleft{} @quoteright{} @quotedblbase{} @quotesinglbase{}
  176. @node @guillemetleft{} @guillemetright{} @guillemotleft{} @guillemotright{} @guilsinglleft{} @guilsinglright{}
  177. @chapter @guillemetleft{} @guillemetright{} @guillemotleft{} @guillemotright{} @guilsinglleft{} @guilsinglright{}
  178. @node `` \'\' --- -- ` \'
  179. @chapter `` \'\' --- -- ` \'
  180. @node @acronym{AAA, fff} @acronym{AAA} @acronym{BBB}
  181. @chapter @acronym{AAA, fff} @acronym{AAA} @acronym{BBB}
  182. @node @abbr{CCC, rrr} @abbr{CCC} @abbr{DDD}
  183. @ifnottex
  184. @chapter @abbr{CCC, rrr} @abbr{CCC} @abbr{DDD}
  185. @end ifnottex
  186. @node @email{someone@@somewher, the someone} @email{no_explain@@there}
  187. @chapter @email{someone@@somewher, the someone} @email{no_explain@@there}
  188. @node @image{f--ile1} @image{f--ile,aze,az,alt,e--xt}
  189. @ifnottex
  190. @chapter @image{f--ile1} @image{f--ile,aze,az,alt,e--xt}
  191. @end ifnottex
  192. @node @verb{. @ {} . .}
  193. @ifnottex
  194. @chapter @verb{. @ {} . .}
  195. @end ifnottex
  196. @node @cite{cite @asis{asis}} @w{in @@w @b{b}} @r{in r} @sc{sc} @strong{str} @t{t} @var{var} @dfn{dfn} @i{i}
  197. @chapter @cite{cite @asis{asis}} @w{in @@w @b{b}} @r{in r} @sc{sc} @strong{str} @t{t} @var{var} @dfn{dfn} @i{i}
  198. @node @env{env} @code{code} @option{option} @samp{samp} @command{command} @file{file} @kbd{C-x @key{ESC}}
  199. @chapter @env{env} @code{code} @option{option} @samp{samp} @command{command} @file{file} @kbd{C-x @key{ESC}}
  200. @node 8.27@dmn{in}
  201. @chapter 8.27@dmn{in}
  202. @node @sansserif{sansserif} @slanted{slanted}
  203. @chapter @sansserif{sansserif} @slanted{slanted}
  204. @node @indicateurl{indicateurl}
  205. @chapter @indicateurl{indicateurl}
  206. @node @sub{g}H 3@sup{rd}
  207. @chapter @sub{g}H 3@sup{rd}
  208. @node @url{http://somewhere_aaa} @url{url, text} @uref{/man.cgi/1/ls,,ls}
  209. @chapter @url{http://somewhere_aaa} @url{url, text} @uref{/man.cgi/1/ls,,ls}
  210. @ref{@- @{ @}}
  211. @ref{@ @ @! @* @. @: .@: @? @@}
  212. @ref{@atchar{} @lbracechar{} @rbracechar{} @backslashchar{} @hashchar{}}
  213. @ref{@LaTeX{} @TeX{} @bullet{} @comma{} @copyright{} @dots{} @enddots{}}
  214. @ref{@equiv{} @error{} @euro{} @exclamdown{} @expansion{} @minus{}}
  215. @ref{@geq{} @leq{} @arrow{}}
  216. @ref{@ordf{} @ordm{} @point{} @pounds{} @print{} @questiondown{} @registeredsymbol{}}
  217. @ref{@result{} @textdegree{} a@tie{}b @today{} @aa{}}
  218. @ref{@AA{} @ae{} @oe{} @AE{} @OE{} @o{} @O{} @ss{} @l{} @L{} @DH{} @dh{} @TH{} @th{}}
  219. @ref{@"{a} @~{e} @^{@dotless{i}} @^{a} @`{a} @\'e @,{c} @={e} @ringaccent{e} @H{e} @ogonek{e}}
  220. @ref{@dotaccent{e} @u{e} @ubaraccent{e} @udotaccent{e} @v{e} @dotless{j} @tieaccent{ee}}
  221. @ref{@dotless{i} @`{@=E} @,{@\'C}}
  222. @ref{@quotedblleft{} @quotedblright{} @quoteleft{} @quoteright{} @quotedblbase{} @quotesinglbase{}}
  223. @ref{@guillemetleft{} @guillemetright{} @guillemotleft{} @guillemotright{} @guilsinglleft{} @guilsinglright{}}
  224. @ref{`` \'\' --- -- ` \'}
  225. @ref{@acronym{AAA, fff} @acronym{AAA} @acronym{BBB}}
  226. @ifnottex
  227. @ref{@abbr{CCC, rrr} @abbr{CCC} @abbr{DDD}}
  228. @end ifnottex
  229. @ref{@email{someone@@somewher, the someone} @email{no_explain@@there}}
  230. @ifnottex
  231. @ref{@image{f--ile1} @image{f--ile,aze,az,alt,e--xt}}
  232. @ref{@verb{. @ {} . .}}
  233. @end ifnottex
  234. @ref{@cite{cite @asis{asis}} @w{in @@w @b{b}} @r{in r} @sc{sc} @strong{str} @t{t} @var{var} @dfn{dfn} @i{i}}
  235. @ref{@env{env} @code{code} @option{option} @samp{samp} @command{command} @file{file} @kbd{C-x @key{ESC}}}
  236. @ref{8.27@dmn{in}}
  237. @ref{@sansserif{sansserif} @slanted{slanted}}
  238. @ref{@indicateurl{indicateurl}}
  239. @ref{@sub{g}H 3@sup{rd}}
  240. @ref{@url{http://somewhere_aaa} @url{url, text} @uref{/man.cgi/1/ls,,ls}}
  241. @bye
  242. ';
  243. my @test_cases = (
  244. ['accentenc',
  245. $latin1_accents_text
  246. ],
  247. ['weird_accents',
  248. $weird_accents_text
  249. ],
  250. ['weird_accents_disable_encoding',
  251. $weird_accents_text, {}, {'ENABLE_ENCODING' => 0}
  252. ],
  253. ['accent',
  254. $accents_text
  255. ],
  256. ['accent_with_text',
  257. '@u{--a} @dotless{--b} @^{--@dotless{i}} @^{--@dotless{j}} @^{--a}
  258. '],
  259. ['empty_accent',
  260. '@`{}
  261. '],
  262. ['some_at_commands_in_ref_nodes',
  263. '
  264. @node Top
  265. @top Top
  266. @menu
  267. * A @sc{sc @~n @aa{} @TeX{}} node @"i @"{@dotless{i}} @`{@=E} @l{} @,{@\'C} @exclamdown{}::
  268. @end menu
  269. @node A @sc{sc @~n @aa{} @TeX{}} node @"i @"{@dotless{i}} @`{@=E} @l{} @,{@\'C} @exclamdown{}
  270. @chapter A @sc{sc} node @"i @"{@dotless{i}} @`{@=E} @l{} @,{@\'C} @exclamdown{}
  271. see @ref{a @strong{strong} ref with @sc{sc}@comma{} a i trema @"i@comma{} a dotless i trema @"{@dotless{i}} @`{@=E} and exclamdown @exclamdown{},,,manual}.
  272. '],
  273. ['at_commands_in_refs',
  274. $at_commands_in_refs_text,
  275. {}, {'TEST' => 1}], # TEST => 1 triggers @today constant expansion for diffs
  276. ['refs_formatting',
  277. '@node chapter
  278. @chapter chapter
  279. @code{@@ref@{chapter,cross ref name@}} @ref{chapter,cross ref name}
  280. @code{@@ref@{chapter,,title@}} @ref{chapter,,title}
  281. @code{@@ref@{chapter,,,file name@}} @ref{chapter,,,file name}
  282. @code{@@ref@{chapter,,,,manual@}} @ref{chapter,,,,manual}
  283. @code{@@ref@{chapter,cross ref name,title,@}} @ref{chapter,cross ref name,title,}
  284. @code{@@ref@{chapter,cross ref name,,file name@}} @ref{chapter,cross ref name,,file name}
  285. @code{@@ref@{chapter,cross ref name,,,manual@}} @ref{chapter,cross ref name,,,manual}
  286. @code{@@ref@{chapter,cross ref name,title,file name@}} @ref{chapter,cross ref name,title,file name}
  287. @code{@@ref@{chapter,cross ref name,title,,manual@}} @ref{chapter,cross ref name,title,,manual}
  288. @code{@@ref@{chapter,cross ref name,title, file name, manual@}} @ref{chapter,cross ref name,title, file name, manual}
  289. @code{@@ref@{chapter,,title,file name@}} @ref{chapter,,title,file name}
  290. @code{@@ref@{chapter,,title,,manual@}} @ref{chapter,,title,,manual}
  291. @code{@@ref@{chapter,,title, file name, manual@}} @ref{chapter,,title, file name, manual}
  292. @code{@@ref@{chapter,,,file name,manual@}} @ref{chapter,,,file name,manual}
  293. @code{@@ref@{(pman)anode,cross ref name@}} @ref{(pman)anode,cross ref name}
  294. @code{@@ref@{(pman)anode,,title@}} @ref{(pman)anode,,title}
  295. @code{@@ref@{(pman)anode,,,file name@}} @ref{(pman)anode,,,file name}
  296. @code{@@ref@{(pman)anode,,,,manual@}} @ref{(pman)anode,,,,manual}
  297. @code{@@ref@{(pman)anode,cross ref name,title,@}} @ref{(pman)anode,cross ref name,title,}
  298. @code{@@ref@{(pman)anode,cross ref name,,file name@}} @ref{(pman)anode,cross ref name,,file name}
  299. @code{@@ref@{(pman)anode,cross ref name,,,manual@}} @ref{(pman)anode,cross ref name,,,manual}
  300. @code{@@ref@{(pman)anode,cross ref name,title,file name@}} @ref{(pman)anode,cross ref name,title,file name}
  301. @code{@@ref@{(pman)anode,cross ref name,title,,manual@}} @ref{(pman)anode,cross ref name,title,,manual}
  302. @code{@@ref@{(pman)anode,cross ref name,title, file name, manual@}} @ref{(pman)anode,cross ref name,title, file name, manual}
  303. @code{@@ref@{(pman)anode,,title,file name@}} @ref{(pman)anode,,title,file name}
  304. @code{@@ref@{(pman)anode,,title,,manual@}} @ref{(pman)anode,,title,,manual}
  305. @code{@@ref@{(pman)anode,,title, file name, manual@}} @ref{(pman)anode,,title, file name, manual}
  306. @code{@@ref@{(pman)anode,,,file name,manual@}} @ref{(pman)anode,,,file name,manual}
  307. @code{@@inforef@{chapter, cross ref name, file name@}} @inforef{chapter, cross ref name, file name}
  308. @code{@@inforef@{chapter@}} @inforef{chapter}
  309. @code{@@inforef@{chapter, cross ref name@}} @inforef{chapter, cross ref name}
  310. @code{@@inforef@{chapter,,file name@}} @inforef{chapter,,file name}
  311. '],
  312. ['top_in_ref',
  313. $top_in_ref_text
  314. ],
  315. ['ref_error_formatting',
  316. '
  317. @code{@@ref@{node@}} @ref{node}
  318. @code{@@ref@{,cross ref name@}} @ref{,cross ref name}
  319. @code{@@ref@{,,title@}} @ref{,,title}
  320. @code{@@ref@{,,,file name@}} @ref{,,,file name}
  321. @code{@@ref@{,,,,manual@}} @ref{,,,,manual}
  322. @code{@@ref@{node,cross ref name@}} @ref{node,cross ref name}
  323. @code{@@ref@{node,,title@}} @ref{node,,title}
  324. @code{@@ref@{node,,,file name@}} @ref{node,,,file name}
  325. @code{@@ref@{node,,,,manual@}} @ref{node,,,,manual}
  326. @code{@@ref@{node,cross ref name,title,@}} @ref{node,cross ref name,title,}
  327. @code{@@ref@{node,cross ref name,,file name@}} @ref{node,cross ref name,,file name}
  328. @code{@@ref@{node,cross ref name,,,manual@}} @ref{node,cross ref name,,,manual}
  329. @code{@@ref@{node,cross ref name,title,file name@}} @ref{node,cross ref name,title,file name}
  330. @code{@@ref@{node,cross ref name,title,,manual@}} @ref{node,cross ref name,title,,manual}
  331. @code{@@ref@{node,cross ref name,title, file name, manual@}} @ref{node,cross ref name,title, file name, manual}
  332. @code{@@ref@{node,,title,file name@}} @ref{node,,title,file name}
  333. @code{@@ref@{node,,title,,manual@}} @ref{node,,title,,manual}
  334. @code{@@ref@{node,,title, file name, manual@}} @ref{node,,title, file name, manual}
  335. @code{@@ref@{node,,,file name,manual@}} @ref{node,,,file name,manual}
  336. @code{@@ref@{,cross ref name,title,@}} @ref{,cross ref name,title,}
  337. @code{@@ref@{,cross ref name,,file name@}} @ref{,cross ref name,,file name}
  338. @code{@@ref@{,cross ref name,,,manual@}} @ref{,cross ref name,,,manual}
  339. @code{@@ref@{,cross ref name,title,file name@}} @ref{,cross ref name,title,file name}
  340. @code{@@ref@{,cross ref name,title,,manual@}} @ref{,cross ref name,title,,manual}
  341. @code{@@ref@{,cross ref name,title, file name, manual@}} @ref{,cross ref name,title, file name, manual}
  342. @code{@@ref@{,,title,file name@}} @ref{,,title,file name}
  343. @code{@@ref@{,,title,,manual@}} @ref{,,title,,manual}
  344. @code{@@ref@{,,title, file name, manual@}} @ref{,,title, file name, manual}
  345. @code{@@ref@{,,,file name,manual@}} @ref{,,,file name,manual}
  346. @code{@@inforef@{,cross ref name @}} @inforef{,cross ref name }
  347. @code{@@inforef@{,,file name@}} @inforef{,,file name}
  348. @code{@@inforef@{,cross ref name, file name@}} @inforef{,cross ref name, file name}
  349. @code{@@inforef@{@}} @inforef{}
  350. @code{@@inforef@{node, cross ref name, file name@}} @inforef{node, cross ref name, file name}
  351. @code{@@inforef@{node@}} @inforef{node}
  352. @code{@@inforef@{node, cross ref name@}} @inforef{node, cross ref name}
  353. @code{@@inforef@{node,,file name@}} @inforef{node,,file name}
  354. '],
  355. ['ref_in_sectioning',
  356. '@contents
  357. @node Top
  358. @top for example @ref{node} (@pxref{node}) (@pxref{Top,,, file, Manual})
  359. @menu
  360. * node::
  361. * chap::
  362. @end menu
  363. @node node
  364. @chapter @xref{node,,title, file name, Manual}.
  365. @node chap
  366. @chapter @ref{node} just node
  367. @section @ref{node, cross ref name} node, crossref arg2
  368. @section @ref{@code{node},, @samp{title}} code node, samptitle arg3
  369. @section @ref{@code{node},,, file name} code node, file name
  370. @section @ref{node,,,, Manual } node and manual
  371. @section @ref{Top,,,, Manual } Top and manual
  372. @section @ref{,,,, Manual } no node just manual
  373. @section @ref{,,, file name} no node just file name
  374. @section @inforef{a, b, c} inforef a b c
  375. @section (@pxref{ Top ,,, file name }) pxref Top file name, spaces
  376. @section (@pxref{,,, file name }) pxref file name only, spaces
  377. @section @xref{Top,,,filename}, xref Top filename only, no spaces
  378. @section @xref{,,,filename}. xref filename only, no spaces
  379. '],
  380. ['unknown_value',
  381. '@value{unknown}'],
  382. ['test_sp',
  383. 'Para
  384. @sp 1
  385. other para
  386. Now lone @@sp:
  387. @sp 1
  388. @sp 2
  389. Para after sp
  390. A
  391. @sp 2
  392. B
  393. sp after para
  394. @sp 1
  395. '],
  396. ['sp_in_example',
  397. '@example
  398. Para
  399. @sp 1
  400. other para
  401. Now lone @@sp:
  402. @sp 1
  403. @sp 2
  404. Para after sp
  405. A
  406. @sp 2
  407. B
  408. sp after para
  409. @sp 1
  410. @end example
  411. '],
  412. ['line_breaks',
  413. '@documentdescription
  414. a document @* yes!
  415. @end documentdescription
  416. @settitle the manual @* new version
  417. @title AWK As A Major Systems Programming @* Language---Revisited
  418. @center in center @* line break
  419. @table @strong
  420. @item with break @* after
  421. @itemx withx breakx @* afterx
  422. Text
  423. @end table
  424. @quotation Q@* uotation
  425. T
  426. @end quotation
  427. '],
  428. ['documentencoding_utf8_and_insertions',
  429. '@documentencoding utf-8
  430. -- --- \'\' `` ` \' @code{in code}. @~e.
  431. @example
  432. -- --- \'\' `` ` \' @code{in code}. @~e.
  433. @end example
  434. '],
  435. ['no_documentencoding_and_insertions',
  436. '
  437. -- --- \'\' `` ` \' @code{in code}. @~e.
  438. @example
  439. -- --- \'\' `` ` \' @code{in code}. @~e.
  440. @end example
  441. '],
  442. ['test_deftypefnnewline',
  443. '
  444. @deftypefnnewline on
  445. @node Top
  446. @deftypefun data-type name arguments...
  447. aaa
  448. @end deftypefun
  449. @deffn fun arg
  450. fff
  451. @end deffn
  452. @deftypefnnewline off
  453. @deftypefun data-type2 name2 arguments2...
  454. aaa2
  455. @end deftypefun
  456. @deffn fun2 arg2
  457. fff2
  458. @end deffn
  459. '],
  460. ['raw_block_commands',
  461. $raw_commands_text,
  462. {'expanded_formats' => ['tex', 'docbook', 'html', 'xml']}
  463. ],
  464. ['raw_block_commands_expand_tex',
  465. $raw_commands_text,
  466. {'expanded_formats' => ['tex', 'docbook', 'html', 'xml']},
  467. {'expanded_formats' => ['tex']},
  468. ],
  469. ['inline',
  470. $inline_text,
  471. ],
  472. ['inline_expand_tex',
  473. $inline_text, {'expanded_formats' => ['tex']},
  474. {'expanded_formats' => ['tex']},
  475. ],
  476. ['inlinefmtifelse',
  477. '@inlinefmtifelse{html,,else html no if}.
  478. @inlinefmtifelse{html,if html,else html}.
  479. @inlinefmtifelse{plaintext,if plaintext no second arg}.
  480. @inlinefmtifelse{plaintext,if plaintext,else plaintext}.
  481. @inlinefmtifelse{xml,if xml empty second arg,}.
  482. @inlinefmtifelse{ docbook , if docbook spaces , else docbook spaces }.
  483. @inlinefmtifelse{ tex , if tex spaces , else tex spaces }.
  484. @inlinefmtifelse{docbook,if docbook,else docbook}.
  485. @inlinefmtifelse{tex,if tex,else tex}.
  486. ',
  487. {'expanded_formats' => []}
  488. ],
  489. ['inlineifsetifclear',
  490. '@inlineifclear{aaa, iclear first }.
  491. @inlineifset{aaa, ifset first }.
  492. @set aaa
  493. @inlineifclear{aaa, ifclear second }.
  494. @inlineifset{aaa, ifset second }.
  495. '],
  496. ['table_in_display_in_example',
  497. '@example
  498. @display
  499. @table @asis
  500. @item item
  501. Line
  502. @end table
  503. @end display
  504. @end example
  505. '],['table_in_example_in_display',
  506. '@display
  507. @example
  508. @table @asis
  509. @item item
  510. Line
  511. @end table
  512. @end example
  513. @end display
  514. '],
  515. ['complex_nestings',
  516. '@node Top
  517. @example
  518. deffs
  519. @defun {my def} args @var{arg} @dots{}
  520. @defunx {other def} no args
  521. @deffn {type} {name} and now the args
  522. @defvar {variables} variable-name
  523. @defvarx {variables too} other-variable
  524. THis is the defvar
  525. A table within the def
  526. @table @asis
  527. @item item
  528. text
  529. more text
  530. @item second item
  531. @end table
  532. explanation
  533. @end defvar
  534. @end deffn
  535. @end defun
  536. @end example
  537. '],
  538. ['verbatiminclude_paths',
  539. '
  540. @verbatiminclude inc_file.texi
  541. @@verbatiminclude dot full path.
  542. @verbatiminclude ./t/include_dir/inc_file.texi
  543. @@verbatiminclude parent
  544. @verbatiminclude ../include_dir/inc_file.texi
  545. @@verbatiminclude dot full parent path
  546. @verbatiminclude ./tp/t/include_dir/inc_file.texi
  547. @c does not work in the standalone perl module
  548. @c @@verbatiminclude full parent path
  549. @c @verbatiminclude tp/t/include_dir/inc_file.texi
  550. ',{'include_directories' => ['.', '..', 't/include_dir']}],
  551. ['image_with_spaces',
  552. '@image{f--ile,,,@ }.
  553. @image{f--ile,,,@:}.
  554. '],
  555. ['image_extension',
  556. '@image{f---ile,,,,gr--a}
  557. '],
  558. ['image_formatting',
  559. '@node Top
  560. @code{@@image@{f--ile@}} @image{f--ile}
  561. @code{@@image@{f--ile,l--i@}} @image{f--ile,l--i}
  562. @code{@@image@{f--ile,,l--e@}} @image{f--ile,,l--e}
  563. @code{@@image@{f--ile,,,alt@}} @image{f--ile,,,alt}
  564. @code{@@image@{f--ile,,,,e-d-xt@}} @image{f--ile,,,,e--xt}
  565. @code{@@image@{f--ile,aze,az,alt,e--xt@}} @image{f--ile,aze,az,alt,e--xt}
  566. @code{@@image@{f-ile,aze,,a--lt@}} @image{f-ile,aze,,a--lt}
  567. @code{@@image@{@@file@{f--ile@}@@@@@@.,aze,az,alt,@@file@{file ext@} e--xt@@@}} @image{@file{f--ile}@@@.,aze,az,alt,@file{file ext} e--xt@}}
  568. @image{image} @image{image}
  569. @example
  570. @code{@@image@{f--ile@}} @image{f--ile}
  571. @code{@@image@{f--ile,l--i@}} @image{f--ile,l--i}
  572. @code{@@image@{f--ile,,l--e@}} @image{f--ile,,l--e}
  573. @code{@@image@{f--ile,,,alt@}} @image{f--ile,,,alt}
  574. @code{@@image@{f--ile,,,,e-d-xt@}} @image{f--ile,,,,e--xt}
  575. @code{@@image@{f--ile,aze,az,alt,e--xt@}} @image{f--ile,aze,az,alt,e--xt}
  576. @code{@@image@{f-ile,aze,,a--lt@}} @image{f-ile,aze,,a--lt}
  577. @code{@@image@{@@file@{f--ile@}@@@@@@.,aze,az,alt,@@file@{file ext@} e--xt@@@}} @image{@file{f--ile}@@@.,aze,az,alt,@file{file ext} e--xt@}}
  578. @image{image} @image{image}
  579. @end example
  580. @image{f--ile,,,a very long alt argument that could span more than one line who knows}
  581. in para
  582. @image{f--ile,,,a very long alt argument that could span more than one line who knows}.
  583. '],
  584. ['enumerate_above_ten',
  585. '@enumerate 14
  586. @item a
  587. @end enumerate
  588. '],
  589. ['footnote_no_number',
  590. '@node Top
  591. Para@footnote{Footnote 1.}.
  592. Para2@footnote{Footnote 2.}.
  593. ',{} , {'NUMBER_FOOTNOTES' => 0}],
  594. ['footnote_no_number_separate',
  595. '@node Top
  596. Para@footnote{Footnote 1.}.
  597. Para2@footnote{Footnote 2.}.
  598. ',{} , {'NUMBER_FOOTNOTES' => 0, 'footnotestyle' => 'separate'}],
  599. ['things_before_setfilename',
  600. undef, {'test_file' => 'things_before_setfilename.texi'}
  601. ],
  602. ['things_before_setfilename_no_element',
  603. undef, {'test_file' => 'things_before_setfilename_no_element.texi'}
  604. ],
  605. ['spaces_in_node_names',
  606. '@node Top
  607. @menu
  608. * a@ @ ::
  609. * b@verb{: :}::
  610. * c@ ::
  611. @end menu
  612. @node a@ @
  613. @node b@verb{: :}
  614. @node c@w{ }
  615. @ref{a@ @ }
  616. @ref{b@verb{: :}}
  617. @ref{c@w{ }}
  618. '],
  619. ['spaces_in_empty_node_names',
  620. '@node Top
  621. @menu
  622. * @ @ ::
  623. * @verb{: :}::
  624. * @ ::
  625. @end menu
  626. @node @ @
  627. @node @verb{: :}
  628. @node @w{ }
  629. @ref{@ @ }
  630. @ref{@verb{: :}}
  631. @ref{@w{ }}
  632. '],
  633. ['normal_font_in_monospace',
  634. '@example
  635. in example @r{in r---now @code{in co---de}}
  636. @end example
  637. @command{in command---c @r{in r---r @file{in file---}}}.
  638. '],
  639. ['index_entry_in_preformatted',
  640. '@node Top
  641. @example
  642. @cindex first
  643. text
  644. @cindex other @c comment
  645. text2
  646. @cindex last
  647. @end example
  648. '],
  649. ['printindex_merged_indices_code_style',
  650. '@node Top
  651. @synindex cp fn
  652. @synindex vr fn
  653. @cindex c``b
  654. @vindex v``j
  655. @findex f``g
  656. @defcodeindex cdi
  657. @synindex cdi fn
  658. @cdiindex cdi``h
  659. @defindex ddi
  660. @syncodeindex ddi cp
  661. @ddiindex ddi``g
  662. @printindex fn
  663. '],
  664. ['email_table_command_as_argument',
  665. '@table @email
  666. @item www-discuss@@gnu.org
  667. discussion
  668. @end table
  669. '],
  670. ['at_commands_in_raw',
  671. '@node Top
  672. @macro othermacro{}
  673. Other macro
  674. @end macro
  675. @html
  676. <b>in b@footnote{in footnote}.</b>
  677. @anchor{anchor in html}
  678. @end html
  679. @kbd{in kbd before tex}@footnote{second footnote}.
  680. @tex
  681. @kbdinputstyle code
  682. in tex@footnote{footnote in tex}
  683. @anchor{anchor in tex}
  684. @cindex entry
  685. @findex fentry1
  686. @float Figs, f1
  687. Float
  688. @caption{Fcaption}
  689. @end float
  690. @menu
  691. * n::
  692. @end menu
  693. @acronym{FF, Fi Foo}
  694. @synindex cp fn
  695. @defindex new
  696. @definfoenclose a,:,:
  697. @alias moviecite = cite
  698. @documentlanguage fr
  699. @errormsg{mymsg}
  700. @ref{Somewhere}.
  701. @set flag soemthing
  702. @macro mymacro{}
  703. truc
  704. @end macro
  705. @macro macroarg{arg}
  706. Some \arg\.
  707. @end macro
  708. @unmacro othermacro
  709. @end tex
  710. @value{flag}.
  711. @kbd{in kbd after tex}.
  712. @xref{anchor in html}.
  713. @ref{anchor in tex}.
  714. @findex fentry2
  715. @newindex newidx entry
  716. @printindex cp
  717. @printindex fn
  718. @listoffloats Figs
  719. @acronym{FF}.
  720. @a{tt}.
  721. @moviecite{movie name}
  722. Macro not unmacroed @othermacro{}.
  723. Macros that should not be defined: @mymacro{}. @macroarg{with arg}.
  724. ', {'expanded_formats' => ['html']}, {'expanded_formats' => ['html']}
  725. ],
  726. );
  727. my @html_text_cases = (
  728. ['accentenc_no_entity',
  729. $latin1_accents_text, {}, {'ENABLE_ENCODING' => 1,
  730. 'ENABLE_ENCODING_USE_ENTITY' => 0}
  731. ],
  732. ['accentenc_enable_encoding',
  733. $latin1_accents_text, {}, {'ENABLE_ENCODING' => 1}
  734. ],
  735. ['top_in_ref_keep_top',
  736. $top_in_ref_text,
  737. {}, {'KEEP_TOP_EXTERNAL_REF' => 1}],
  738. );
  739. my @file_tests = (
  740. ['char_latin1_utf8_in_refs',
  741. undef, {'test_file' => 'char_latin1_utf8_in_refs.texi'}
  742. ],
  743. ['char_latin1_latin1_in_refs',
  744. undef, {'test_file' => 'char_latin1_latin1_in_refs.texi'}
  745. ],
  746. ['char_latin2_latin2_in_refs',
  747. undef, {'test_file' => 'char_latin2_latin2_in_refs.texi'}
  748. ],
  749. ['japanese_shift_jis',
  750. undef, {'test_file' => 'japanese_shift_jis.texi'}
  751. ],
  752. ['sample_utf8',
  753. undef, {'test_file' => 'sample_utf8.texi'}
  754. ],
  755. ['at_commands_in_refs_utf8',
  756. '@setfilename at_commands_in_refs_utf8.info
  757. @documentencoding utf-8
  758. '.
  759. $at_commands_in_refs_text,
  760. {'todo' =>
  761. {'file_info' => 'different results from XS and pure Perl modules',
  762. }}, {'TEST' => 1}], # TEST => 1 triggers @today constant expansion for diffs
  763. ['at_commands_in_refs_latin1',
  764. '@setfilename at_commands_in_refs_latin1.info
  765. @documentencoding ISO-8859-15
  766. '.
  767. $at_commands_in_refs_text,
  768. {}, {'TEST' => 1}], # TEST => 1 triggers @today constant expansion for diffs
  769. );
  770. my %info_tests = (
  771. 'image_with_spaces' => 1,
  772. 'image_extension' => 1,
  773. 'image_formatting' => 1,
  774. 'footnote_no_number' => 1,
  775. 'footnote_no_number_separate' => 1,
  776. 'some_at_commands_in_ref_nodes' => 1,
  777. 'at_commands_in_refs' => 1,
  778. 'things_before_setfilename' => 1,
  779. 'things_before_setfilename_no_element' => 1,
  780. 'spaces_in_node_names' => 1,
  781. 'spaces_in_empty_node_names' => 1,
  782. );
  783. my %html_tests = (
  784. 'at_commands_in_refs' => 1,
  785. 'things_before_setfilename' => 1,
  786. 'things_before_setfilename_no_element' => 1,
  787. 'line_breaks' => 1,
  788. );
  789. my %xml_file_tests = (
  790. 'char_latin1_latin1_in_refs' => 1,
  791. );
  792. foreach my $test (@test_cases) {
  793. push @{$test->[2]->{'test_formats'}}, 'plaintext';
  794. if ($html_tests{$test->[0]}) {
  795. push @{$test->[2]->{'test_formats'}}, 'html';
  796. } else {
  797. push @{$test->[2]->{'test_formats'}}, 'html_text';
  798. }
  799. push @{$test->[2]->{'test_formats'}}, 'xml';
  800. push @{$test->[2]->{'test_formats'}}, 'docbook';
  801. push @{$test->[2]->{'test_formats'}}, 'info'
  802. if ($info_tests{$test->[0]});
  803. }
  804. foreach my $test (@html_text_cases) {
  805. push @{$test->[2]->{'test_formats'}}, 'html_text';
  806. }
  807. foreach my $test (@file_tests) {
  808. push @{$test->[2]->{'test_formats'}}, 'file_html';
  809. push @{$test->[2]->{'test_formats'}}, 'file_info';
  810. if ($xml_file_tests{$test->[0]}) {
  811. push @{$test->[2]->{'test_formats'}}, ('file_xml', 'file_docbook');
  812. }
  813. }
  814. our ($arg_test_case, $arg_generate, $arg_debug);
  815. run_all ('converters_tests', [@test_cases, @file_tests, @html_text_cases],
  816. $arg_test_case, $arg_generate, $arg_debug);
  817. 1;