30sectioning.t 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940
  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 $sections_no_top_text =
  6. '@chapter chapter
  7. @section section
  8. @subsection subsection
  9. @subsubsection subsubsection
  10. @part part
  11. @chapter chapter in part
  12. @chapter second chapter in part
  13. @unnumbered unnumbered
  14. @appendix appendix
  15. @appendixsec appendixsec
  16. ';
  17. my $test_text =
  18. '@top top
  19. '.$sections_no_top_text;
  20. my $chapter_sections_text =
  21. '@unnumbered unnumbered
  22. @chapter First chapter
  23. @section second
  24. @chapter Chapter
  25. @section Section of chapter
  26. @subsection subsection 1
  27. @subsection subsection 2
  28. @chapter Chapter 2
  29. ';
  30. my $top_chapter_sections_text =
  31. '@top top
  32. '.$chapter_sections_text;
  33. my $unnumbered_top_without_node_text =
  34. '@node a node,,,(dir)
  35. @unnumbered unnumbered
  36. in unnumbered
  37. @top top section
  38. Top section
  39. @node second,,,(dir)
  40. @chapter Chapter
  41. Text of chapter
  42. ';
  43. my $top_without_node_text =
  44. '@top top section
  45. Top section
  46. @node second,,,(dir)
  47. @chapter Chapter
  48. Text of chapter
  49. ';
  50. my $section_in_unnumbered_text = '
  51. @node Top
  52. @top Test section in unnumbered
  53. @contents
  54. Menu:
  55. @menu
  56. * chapter::
  57. * unnumbered::
  58. * chapter 2::
  59. * chapter 3::
  60. * unnumbered 4::
  61. @end menu
  62. @node chapter
  63. @chapter chapter
  64. @menu
  65. * section in chapter::
  66. @end menu
  67. @node section in chapter
  68. @section section in chapter
  69. @node unnumbered
  70. @unnumbered unnumbered
  71. @menu
  72. * section in unnumbered::
  73. @end menu
  74. @node section in unnumbered
  75. @section section in unnumbered
  76. @node chapter 2
  77. @chapter chapter 2
  78. @menu
  79. * unnumberedsec 2::
  80. * unnumberedsec 2-1::
  81. @end menu
  82. @node unnumberedsec 2
  83. @unnumberedsec unnumbered section 2
  84. @menu
  85. * unnumbered sub 2::
  86. * numbered sub 2::
  87. * unnumbered sub2 2::
  88. * numbered sub2 2::
  89. @end menu
  90. @node unnumbered sub 2
  91. @unnumberedsubsec unnumbered subsection 2
  92. @node numbered sub 2
  93. @subsection numbered subsection 2
  94. @node unnumbered sub2 2
  95. @unnumberedsubsec unnumbered subsection2 2
  96. @node numbered sub2 2
  97. @subsection numbered subsection2 2
  98. @node unnumberedsec 2-1
  99. @unnumberedsec unnumberedsec 2-1
  100. @menu
  101. * numbered sub 2-1::
  102. @end menu
  103. @node numbered sub 2-1
  104. @subsection numbered subsection 2-1
  105. @node chapter 3
  106. @chapter chapter 3
  107. @menu
  108. * unnumberedsec 3::
  109. * section 3-1::
  110. * unnumberedsec 3-2::
  111. * section 3-3::
  112. * unnumberedsec 3-4::
  113. @end menu
  114. @node unnumberedsec 3
  115. @unnumberedsec unnumbered section 3
  116. @menu
  117. * unnumbered sub 3::
  118. * numbered sub 3::
  119. * unnumbered sub2 3::
  120. * numbered sub2 3::
  121. @end menu
  122. @node unnumbered sub 3
  123. @unnumberedsubsec unnumbered subsection 3
  124. @node numbered sub 3
  125. @subsection numbered subsection 3
  126. @node unnumbered sub2 3
  127. @unnumberedsubsec unnumbered subsection2 3
  128. @node numbered sub2 3
  129. @subsection numbered subsection2 3
  130. @node section 3-1
  131. @section section 3-1
  132. @node unnumberedsec 3-2
  133. @unnumberedsec unnumberedsec 3-2
  134. @menu
  135. * numbered sub 3-2::
  136. @end menu
  137. @node numbered sub 3-2
  138. @subsection numbered subsection 3-2
  139. @node section 3-3
  140. @section section 3-3
  141. @menu
  142. * subsection 3-3::
  143. @end menu
  144. @node subsection 3-3
  145. @subsection subsection 3-3
  146. @node unnumberedsec 3-4
  147. @unnumberedsec unnumberedsec 3-4
  148. @menu
  149. * numbered sub 3-4::
  150. @end menu
  151. @node numbered sub 3-4
  152. @subsection numbered subsection 3-4
  153. @node unnumbered 4
  154. @unnumbered unnumbered 4
  155. @menu
  156. * unnumberedsec 4::
  157. @end menu
  158. @node unnumberedsec 4
  159. @unnumberedsec unnumbered section 4
  160. @menu
  161. * unnumbered sub 4::
  162. * numbered sub 4::
  163. * unnumbered sub2 4::
  164. * numbered sub2 4::
  165. @end menu
  166. @node unnumbered sub 4
  167. @unnumberedsubsec unnumbered subsection 4
  168. @node numbered sub 4
  169. @subsection numbered subsection 4
  170. @node unnumbered sub2 4
  171. @unnumberedsubsec unnumbered subsection2 4
  172. @node numbered sub2 4
  173. @subsection numbered subsection2 4
  174. ';
  175. my $anchor_in_footnote_text = '@node Top
  176. @top Top
  177. In top node@footnote{in footnote
  178. @anchor{Anchor in footnote}.
  179. }
  180. @menu
  181. * chapter::
  182. @end menu
  183. @node chapter
  184. @chapter Chap
  185. @ref{Anchor in footnote}.
  186. ';
  187. my $nodes_after_top_before_chapter_text =
  188. '@node Top
  189. Top node
  190. @menu
  191. * second node::
  192. * third node::
  193. @end menu
  194. @node second node, third node,Top,Top
  195. second node
  196. @node third node,,second node,Top
  197. @chapter chapter
  198. ';
  199. my $nodes_after_top_before_section_text =
  200. '@node Top
  201. Top node
  202. @menu
  203. * second node::
  204. * third node::
  205. @end menu
  206. @node second node, third node,Top,Top
  207. second node
  208. @node third node,,second node,Top
  209. @subsection subsection
  210. ';
  211. my @tests_converted = (
  212. ['contents',
  213. $test_text.
  214. '
  215. @contents
  216. '],
  217. ['shortcontents',
  218. $test_text.
  219. '
  220. @shortcontents
  221. '],
  222. ['contents_and_shortcontents',
  223. $test_text.
  224. '
  225. @shortcontents
  226. @contents
  227. '],
  228. ['one_subsection',
  229. '@subsection The subsection
  230. '],
  231. ['section_below_unnumbered',
  232. '
  233. @contents
  234. @node Top
  235. @top Top
  236. Top node.
  237. @menu
  238. * Unn::
  239. @end menu
  240. @node Unn
  241. @unnumbered Unn
  242. @menu
  243. * Sec::
  244. @end menu
  245. @node Sec
  246. @section Sec
  247. Should be unnumbered.
  248. @bye
  249. '],
  250. ['section_below_unnumbered_no_top',
  251. '@unnumbered U
  252. @section S
  253. '],
  254. ['top_no_argument_and_content',
  255. '@top
  256. A.
  257. '],
  258. ['section_before_part',
  259. '@section section
  260. @part part
  261. @contents
  262. '],
  263. ['chapter_before_part',
  264. '@chapter chapter
  265. @part part
  266. ',{'test_split' => 'section'}],
  267. ['part_before_top',
  268. '@part part
  269. @top top
  270. ',{'test_split' => 'section'}],
  271. ['part_before_chapter',
  272. '@part part
  273. @chapter chapter
  274. ',{'test_split' => 'section'}],
  275. ['double_part',
  276. '@node Top
  277. @top top
  278. @menu
  279. * node chapter::
  280. @end menu
  281. @part part first
  282. Text part first.
  283. @part part second
  284. Text part second.
  285. @node node chapter
  286. @chapter chapter after 2 parts
  287. ', {'test_split' => 'section', 'test_split_pages' => 'chapter'}
  288. ],
  289. ['setfilename_on_top_and_after_node',
  290. '@node Top
  291. @top In top @setfilename very badly placed setfilename
  292. @setfilename a bit too late
  293. '],
  294. ['section_in_unnumbered_plaintext',
  295. $section_in_unnumbered_text
  296. ],
  297. ['two_unnumbered_no_argument',
  298. '@unnumbered
  299. @unnumbered
  300. '],
  301. ['no_argument_and_contents',
  302. '@contents
  303. @top for example
  304. @chapter @asis{}
  305. '],
  306. ['node_up_external_node',
  307. '@node Top
  308. @menu
  309. * first::
  310. @end menu
  311. @node first, (manual1), (manual2) , (manual3)
  312. ', {'test_split' => 'node'}],
  313. ['two_nodes_between_chapters',
  314. '@node Top
  315. @top top
  316. @menu
  317. * chapter 1::
  318. * node between chapters::
  319. * chapter 2::
  320. @end menu
  321. @node chapter 1, Top, node between chapters, Top
  322. @chapter chapter c1
  323. @node node between chapters
  324. @node chapter 2
  325. @chapter chapter c2
  326. ', {'test_split' => 'section'}],
  327. ['two_nodes_at_the_end',
  328. '@node Top
  329. @top top
  330. @menu
  331. * chapter 1::
  332. * node after chapter 1::
  333. * node after chapter 2::
  334. @end menu
  335. @node chapter 1, node after chapter 1, Top, Top
  336. @chapter chapter c1
  337. @node node after chapter 1
  338. @node node after chapter 2
  339. ', {'test_split' => 'section'}],
  340. ['chapter_before_and_after_part',
  341. '@chapter chapter
  342. @part part
  343. @chapter chapter 2
  344. @contents
  345. ', {'test_split' => 'section'}
  346. ],
  347. ['lone_contents',
  348. '@contents
  349. '],
  350. ['contents_with_only_top_node',
  351. '
  352. @node Top
  353. @contents
  354. '],
  355. );
  356. my $character_and_spaces_in_refs_text = '@node Top
  357. @top Test refs
  358. @menu
  359. * other nodes::
  360. @end menu
  361. @subheading Testing distant nodes
  362. @ref{ a node ,,, manual}
  363. @ref{:,,,manual}
  364. @ref{ top ,,, manual}
  365. @ref{(texinfo)Cross References}
  366. @ref{node,,, ../manual/doc.texi}
  367. @subheading Testing local nodes
  368. @ref{!_"#$%&\'()*+-.}
  369. @ref{/;<=>?[\\]^_`|~}
  370. @ref{ Top}
  371. @ref{ local node}
  372. @node other nodes, !_"#$%&\'()*+-., Top, Top
  373. @chapter Chapter with nodes
  374. @menu
  375. * !_"#$%&\'()*+-.::
  376. * /;<=>?[\\]^_`|~::
  377. * local node::
  378. @end menu
  379. @node !_"#$%&\'()*+-., /;<=>?[\]^_`|~, other nodes, other nodes
  380. @node /;<=>?[\]^_`|~,local node,!_"#$%&\'()*+-., other nodes
  381. @node local node,,/;<=>?[\\]^_`|~,other nodes
  382. @bye
  383. ';
  384. my @tests_info = (
  385. ['anchor_zero',
  386. '@node Top
  387. @anchor{0}.
  388. @xref{0}.
  389. '],
  390. ['top_no_argument_and_node',
  391. '@node start
  392. @top
  393. '],
  394. ['top_no_argument_and_top_node',
  395. '@node Top
  396. @top
  397. '],
  398. ['one_subsection_and_node',
  399. '@node one node
  400. @subsection The subsection
  401. '],
  402. ['character_and_spaces_in_refs',
  403. $character_and_spaces_in_refs_text],
  404. ['character_and_spaces_in_node',
  405. '
  406. @node Top
  407. @node other nodes, !_"#$%&\'()*+-., Top, Top
  408. @node !_"#$%&\'()*+-., /;<=>?[\\]^_`|~, other nodes, other nodes
  409. @node /;<=>?[\\]^_`|~,local node,!_"#$%&\'()*+-., other nodes
  410. @node local node,,/;<=>?[\\]^_`|~,other nodes
  411. '],
  412. ['double_node_anchor_float',
  413. '@node node1
  414. @node node1
  415. @anchor{node1}
  416. @anchor{anchor1}
  417. @node anchor1
  418. @float Text, node1
  419. @end float
  420. @float Text, anchor1
  421. @end float
  422. @float Text, float1
  423. @end float
  424. @node float1
  425. '],
  426. ['double_top',
  427. '@node ToP, top
  428. @node top,,ToP,Top
  429. @anchor{TOP}.
  430. '],
  431. ['ref_to_top',
  432. '
  433. @node ToP
  434. @top top
  435. @xref{TOP}.
  436. '],
  437. ['equivalent_nodes',
  438. '@node Top, @emph{node}
  439. @menu
  440. * @strong{node}::
  441. @end menu
  442. @node @samp{node}
  443. @xref{node}.
  444. '],
  445. ['equivalent_labels',
  446. '@node Top
  447. @anchor{@samp{anch}}.
  448. @float truc, floa
  449. In float
  450. @end float
  451. @menu
  452. * anch::
  453. * @code{floa}::
  454. @end menu
  455. '],
  456. ['anchor_in_footnote',
  457. $anchor_in_footnote_text
  458. ],
  459. ['anchor_in_footnote_separate',
  460. '@footnotestyle separate
  461. '.
  462. $anchor_in_footnote_text
  463. ],
  464. ['no_element',
  465. '@settitle no_element test
  466. @documentencoding ISO-8859-1
  467. @anchor{An anchor}
  468. Ref to the anchor:
  469. @ref{An anchor}
  470. Ref to the anchor in footnote:
  471. @ref{Anchor in footnote}.
  472. @footnote{In footnote.
  473. @anchor{Anchor in footnote}
  474. Ref to main text anchor
  475. @ref{An anchor}
  476. }
  477. @float , float anchor
  478. In float
  479. @end float
  480. Ref to float
  481. @ref{float anchor}.
  482. @menu
  483. * An anchor:: menu entry pointing to the anchor.
  484. @end menu
  485. @cindex index entry
  486. '],
  487. ['placed_things_before_element',
  488. '@anchor{An anchor}
  489. Ref to the anchor:
  490. @ref{An anchor}
  491. Ref to the anchor in footnote:
  492. @ref{Anchor in footnote}.
  493. @footnote{In footnote.
  494. @anchor{Anchor in footnote}
  495. Ref to main text anchor
  496. @ref{An anchor}
  497. }
  498. @float , float anchor
  499. In float
  500. @end float
  501. Ref to float
  502. @ref{float anchor}.
  503. @menu
  504. * An anchor:: menu entry pointing to the anchor.
  505. @end menu
  506. @cindex index entry
  507. @section section
  508. Ref to anchor
  509. @ref{An anchor}
  510. Ref to footnote anchor
  511. @ref{Anchor in footnote}
  512. '],
  513. ['placed_things_before_node',
  514. '@anchor{An anchor}
  515. Ref to the anchor:
  516. @ref{An anchor}
  517. Ref to the anchor in footnote:
  518. @ref{Anchor in footnote}.
  519. @footnote{In footnote.
  520. @anchor{Anchor in footnote}
  521. Ref to main text anchor
  522. @ref{An anchor}
  523. }
  524. @float , float anchor
  525. In float
  526. @end float
  527. Ref to float
  528. @ref{float anchor}.
  529. @menu
  530. * An anchor:: menu entry pointing to the anchor.
  531. @end menu
  532. @cindex index entry
  533. @node Top
  534. @top top section
  535. Ref to anchor
  536. @ref{An anchor}
  537. Ref to footnote anchor
  538. @ref{Anchor in footnote}
  539. '],
  540. ['explicit_node_directions',
  541. '@node Top
  542. Top node
  543. @menu
  544. * second node::
  545. * third node::
  546. @end menu
  547. @node second node, third node,Top,Top
  548. second node
  549. @node third node,,second node,Top
  550. ', {'test_split' => 'node'}],
  551. ['nodes_after_top_before_chapter_nodes',
  552. $nodes_after_top_before_chapter_text,
  553. {'test_split' => 'node'}],
  554. ['nodes_after_top_before_chapter_sections',
  555. $nodes_after_top_before_chapter_text,
  556. {'test_split' => 'section'}],
  557. ['nodes_after_top_before_section_nodes',
  558. $nodes_after_top_before_section_text,
  559. {'test_split' => 'node'}],
  560. ['nodes_after_top_before_section_sections',
  561. $nodes_after_top_before_section_text,
  562. {'test_split' => 'section'}],
  563. ['top_node_no_menu_direction',
  564. '@node Top
  565. @menu
  566. * second node::
  567. * TOP:: myself
  568. @end menu
  569. @node second node,,top,TOP
  570. '],
  571. ['nodes_no_node_top_explicit_directions',
  572. '@node first,,,(dir)
  573. first node
  574. @menu
  575. * second node::
  576. @end menu
  577. @node second node,,first,first
  578. second node
  579. ',{'test_split' => 'node'}],
  580. ['one_node_explicit_directions_anchor',
  581. '@node one node,,,(dir)
  582. Top node
  583. anchor ref @anchor{ref}.
  584. ref to ref @ref{ref}.
  585. '],
  586. ['chapter_between_nodes',
  587. '
  588. @node Top
  589. @top top section
  590. Top node
  591. @menu
  592. * section node::
  593. @end menu
  594. @chapter Chapter
  595. In chapter
  596. @node section node,,,Top
  597. @section section
  598. section.
  599. @contents
  600. '],
  601. ['part_node_before_top',
  602. '@node part node before top, Top,,Top
  603. @part part
  604. @node Top
  605. @top top
  606. @menu
  607. * part node before top::
  608. @end menu
  609. ', {'test_split' => 'section'}],
  610. ['part_node_after_top',
  611. '@node Top
  612. @top top
  613. @menu
  614. * part node after top::
  615. @end menu
  616. @node part node after top
  617. @part part
  618. ', {'test_split' => 'section'}],
  619. ['part_chapter_after_top',
  620. '@node Top
  621. @top top
  622. @menu
  623. * chapter::
  624. @end menu
  625. @part part
  626. @node chapter
  627. @chapter chapter
  628. ', {'test_split' => 'section'}],
  629. ['part_node_chapter_after_top',
  630. '@node Top
  631. @top top
  632. @menu
  633. * a node after part::
  634. * chapter::
  635. @end menu
  636. @part part
  637. @node a node after part, chapter, Top, Top
  638. After a node after part
  639. @node chapter, a node after part,, Top
  640. @chapter chapter
  641. ', {'test_split' => 'section'}],
  642. ['node_part_chapter_after_top',
  643. '@node Top
  644. @top top
  645. @menu
  646. * chapter node::
  647. @end menu
  648. @node chapter node
  649. @part part
  650. @chapter chapter
  651. ', {'test_split' => 'section'}],
  652. ['node_part_chapter_after_chapter',
  653. '@node Top
  654. @top top
  655. @menu
  656. * chapter node::
  657. * part chapter node::
  658. @end menu
  659. @node chapter node
  660. @chapter chapter node
  661. @node part chapter node
  662. @part part
  663. @chapter chapter with part node
  664. @contents
  665. ',{'test_formats' => ['plaintext'], 'test_split' => 'section'} ],
  666. ['part_node_chapter_appendix',
  667. '@node Top
  668. @top top
  669. @menu
  670. * chapter node::
  671. @end menu
  672. @part Part 1
  673. @node chapter node
  674. @chapter chapter
  675. @appendix Appendix
  676. ', {'test_split' => 'section'}],
  677. ['part_node_part_appendix',
  678. '@node Top
  679. @top top
  680. @menu
  681. * chapter node::
  682. @end menu
  683. @part Part 1
  684. @node chapter node
  685. @chapter chapter
  686. @part Part Appendix
  687. @appendix Appendix
  688. ', {'test_split' => 'section'}],
  689. ['part_node_chapter_node_appendix',
  690. '@node Top
  691. @top top
  692. @menu
  693. * chapter node::
  694. * appendix node::
  695. @end menu
  696. @part Part 1
  697. @node chapter node
  698. @chapter chapter
  699. @node appendix node
  700. @appendix Appendix
  701. ', {'test_split' => 'section'}],
  702. ['part_node_part_node_appendix',
  703. '@node Top
  704. @top top
  705. @menu
  706. * chapter node::
  707. * appendix node::
  708. @end menu
  709. @part Part 1
  710. @node chapter node
  711. @chapter chapter
  712. @part Part Appendix
  713. @node appendix node
  714. @appendix Appendix
  715. ', {'test_split' => 'section'}],
  716. ['part_node_node_part_appendix',
  717. '@node Top
  718. @top top
  719. @menu
  720. * chapter node::
  721. * appendix part::
  722. @end menu
  723. @part Part 1
  724. @node chapter node
  725. @chapter chapter
  726. @node appendix part
  727. @part Part Appendix
  728. @appendix Appendix
  729. ', {'test_split' => 'section'}],
  730. ['unnumbered_before_top_node',
  731. '@unnumbered before nodes
  732. @node Top
  733. Top node
  734. @titlefont{Title titlefont}
  735. ', {'test_split' => 'section'}],
  736. ['unnumbered_before_node_top_top',
  737. '@unnumbered before nodes
  738. in unnumbered
  739. @node Top
  740. @top top section
  741. Top node
  742. ', {'test_split' => 'section'}],
  743. ['section_before_top',
  744. '@node section node,,,Top
  745. @section section
  746. @node Top
  747. @top top
  748. @menu
  749. * section node::
  750. @end menu
  751. '],
  752. ['section_chapter_before_top_nodes',
  753. '@node section node
  754. @section section
  755. @node chapter node
  756. @chapter chapter
  757. @menu
  758. * section node::
  759. @end menu
  760. @node Top
  761. @top top
  762. @menu
  763. * chapter node::
  764. @end menu
  765. '],
  766. ['section_node_before_part',
  767. '
  768. @node Top
  769. @section section
  770. @part part
  771. '],
  772. ['top_node_part_top',
  773. '@node Top
  774. @part part
  775. @top top
  776. ', {'test_split' => 'section'}],
  777. ['chapter_node_before_and_after_part',
  778. '
  779. @node Top
  780. @chapter chapter
  781. @menu
  782. * after::
  783. @end menu
  784. @part part
  785. @node after
  786. @chapter chapter 2
  787. @contents
  788. ',{'test_formats' => ['plaintext']}],
  789. ['section_in_unnumbered_info',
  790. $section_in_unnumbered_text
  791. ],
  792. ['top_without_node_sections',
  793. $top_without_node_text,
  794. {'test_split' => 'section'}],
  795. ['top_without_node_nodes',
  796. $top_without_node_text,
  797. {'test_split' => 'node'}],
  798. ['unnumbered_top_without_node_sections',
  799. $unnumbered_top_without_node_text,
  800. {'test_split' => 'section'}],
  801. ['unnumbered_top_without_node_nodes',
  802. $unnumbered_top_without_node_text,
  803. {'test_split' => 'node'}],
  804. ['space_in_node',
  805. '
  806. @node Top
  807. @menu
  808. * Chap first here::
  809. * Test title :Test title.
  810. * Last with spaces ::
  811. @end menu
  812. @node Chap first here
  813. @node Test title
  814. @node Last with spaces
  815. '],
  816. ['next_in_menu_is_below',
  817. '@node Top
  818. @top top
  819. @menu
  820. * chapter::
  821. @end menu
  822. @node chapter
  823. @chapter chapter
  824. @menu
  825. * section::
  826. * subsection::
  827. @end menu
  828. @node section
  829. @section section
  830. @menu
  831. * subsection::
  832. @end menu
  833. @node subsection
  834. @subsection subsection
  835. '],
  836. ['empty_top_node_up',
  837. '@node Top
  838. @top empty top node up
  839. @menu
  840. * first::
  841. @end menu
  842. @node first
  843. ',{'TOP_NODE_UP' => ''}
  844. ],
  845. ['node_up_direction_for_top_with_manual',
  846. '@node Top,,,(dir)top
  847. '],
  848. ['internal_top_node_up',
  849. '@node Top
  850. @top internal top node up
  851. @menu
  852. * first::
  853. @end menu
  854. @node first
  855. ',{'TOP_NODE_UP' => 'node@@ node', 'test_split' => 'node'}
  856. ],
  857. ['top_node_up_url',
  858. '@node Top
  859. @top internal top node up
  860. @menu
  861. * first::
  862. @end menu
  863. @node first
  864. ',{'TOP_NODE_UP' => '@acronym{GNU, @acronym{GNU}\'s Not Unix} manuals',
  865. 'test_split' => 'node'}, {'TOP_NODE_UP_URL' => 'http://www.gnu.org/manual/'}
  866. ],
  867. ['non_automatic_top_node_up_url',
  868. '@node Top, first, (dir), (dir)
  869. @top internal top node up
  870. @menu
  871. * first::
  872. @end menu
  873. @node first, , Top, (dir)
  874. ',{'test_split' => 'node'},{'TOP_NODE_UP_URL' => 'http://www.gnu.org/manual/'}
  875. ],
  876. ['non_automatic_internal_top_node_up',
  877. '@node Top, first, @acronym{GNU, @acronym{GNU}\'s Not Unix} manuals, @acronym{GNU, @acronym{GNU}\'s Not Unix} manuals
  878. @top internal top node up
  879. @menu
  880. * first::
  881. @end menu
  882. @node first, , Top, @acronym{GNU, @acronym{GNU}\'s Not Unix} manuals
  883. ',{'TOP_NODE_UP' => '@acronym{GNU, @acronym{GNU}\'s Not Unix} manuals',
  884. 'test_split' => 'node'}
  885. ],
  886. ['non_automatic_top_node_up_and_url',
  887. '@node Top, first, @acronym{GNU, @acronym{GNU}\'s Not Unix} manuals, @acronym{GNU, @acronym{GNU}\'s Not Unix} manuals
  888. @top internal top node up
  889. @menu
  890. * first::
  891. @end menu
  892. @node first, , Top, @acronym{GNU, @acronym{GNU}\'s Not Unix} manuals
  893. ',{'TOP_NODE_UP' => '@acronym{GNU, @acronym{GNU}\'s Not Unix} manuals',
  894. 'test_split' => 'node'},
  895. {'TOP_NODE_UP_URL' => 'http://www.gnu.org/manual/'}
  896. ],
  897. ['protected_node_parentheses',
  898. '
  899. @node Top
  900. @top top
  901. @menu
  902. * @asis{(}manual) name::
  903. @end menu
  904. @node @asis{(}manual) name
  905. @anchor{@asis{(}manual2) name2}
  906. @ref{@asis{(}manual2) name2}.
  907. '],
  908. );
  909. my $complex_case = '@node Top,First node,(dir)
  910. @top
  911. @menu
  912. * First node::
  913. * between node::
  914. * Second node:: node 2
  915. * Third node unnumbered:: unnumbered in Top menu
  916. * continuity::
  917. * Last node no description::
  918. @end menu
  919. @node First node,,Top,Top
  920. @chapter first node chapter
  921. first node chapter text
  922. @menu
  923. * unnumbered:: un
  924. * unnumbered2:: un2
  925. * numbered:: nu
  926. @end menu
  927. @node unnumbered
  928. @unnumberedsec unnumbered section
  929. @menu
  930. * unnumbered sub:: un
  931. * numbered sub:: nu
  932. * unnumbered sub2:: un2
  933. * numbered sub2:: nu2
  934. @end menu
  935. @node unnumbered sub
  936. @unnumberedsubsec unnumbered subsection
  937. @node numbered sub
  938. @subsection numbered subsection
  939. @node unnumbered sub2
  940. @unnumberedsubsec unnumbered subsection2
  941. @node numbered sub2
  942. @subsection numbered subsection2
  943. @node unnumbered2
  944. @unnumberedsec unnumbered section2
  945. @menu
  946. * numbered sub3::
  947. @end menu
  948. @node numbered sub3
  949. @subsection numbered subsection3
  950. @node numbered
  951. @section numbered section
  952. @node between node,,,Top
  953. between node, node without sectioning node
  954. @node Second node,Third node unnumbered,,Top
  955. Second node text
  956. @chapter second node chapter
  957. second node chapter text.
  958. @node Third node unnumbered
  959. @unnumbered unnumbered chapter
  960. unnumbered chapter text.
  961. @node continuity, Third node unnumbered, Last node no description, Top
  962. @unnumbered unnumbered continuity
  963. Unumbered and node needed for continuity between automatic
  964. directions and lone node.
  965. @node Last node no description,,continuity,Top
  966. @contents
  967. @bye
  968. ';
  969. my @test_cases = (
  970. ['node_too_much_args',
  971. '@node Top, , , , (dir)'
  972. ],
  973. [ 'node',
  974. '
  975. @node one arg1
  976. @node one arg2, two arg
  977. @node one arg3, two arg, three arg
  978. @node one arg4, two arg, three arg, four arg
  979. @node one arg5, two arg, three arg, four arg, five arg
  980. @node comment @comment
  981. @node arg1 @comma{} arg2, @,cedilla, @strong{comma in strong,} @c comma , end
  982. '],
  983. ['empty_nodes_with_commands',
  984. '
  985. @node @c comment
  986. @node @
  987. @node @:
  988. @node @asis{ }
  989. '],
  990. ['empty_refs',
  991. '@xref{@:}.
  992. @xref{@asis{ }}.
  993. '],
  994. ['at_commands_in_node',
  995. '@node A @sc{sc} node @"i @"{@dotless{i}} @`{@=E} @l{} @,{@\'C} @exclamdown{}'
  996. ],
  997. ['email_in_node',
  998. '@node @email{ a } @email{c , d} @email{ , e}
  999. '],
  1000. ['sections',
  1001. '@chapter a chapter
  1002. '],
  1003. ['unnumbered_no_argument',
  1004. '@unnumbered
  1005. '],
  1006. ['a_comma_after_node',
  1007. '@node Commands, Requirements, Nodes and Menus
  1008. A comma in text, end.
  1009. '],
  1010. ['nodename_parentheses',
  1011. '@node Top
  1012. @top The top node
  1013. @menu
  1014. * Node (with parentheses)::
  1015. * Other node::
  1016. * (manual)node::
  1017. @end menu
  1018. @node Node (with parentheses)
  1019. @chapter Section (nodename with parentheses)
  1020. Dummy section
  1021. @node Other node
  1022. @chapter Section (nodename without parentheses)
  1023. Dummy link to @ref{Node (with parentheses)}.
  1024. Dummy link to @ref{(manual)node}.
  1025. @node (manual)node
  1026. @chapter (manual)node
  1027. Dummy section with (manual)node node syntax.
  1028. @anchor{(manual)anchor}.
  1029. '],
  1030. ['node_nested_parentheses',
  1031. '@node Top
  1032. @menu
  1033. * ((some) file)::
  1034. * (other (file))node name::
  1035. * (@code{open(}) close)::
  1036. * (@code{)))} error::
  1037. @end menu
  1038. '],
  1039. ['node_empty_direction',
  1040. '@node name, '
  1041. ],
  1042. ['unknown_node_in_menu',
  1043. '@node Top
  1044. @menu
  1045. * unknown::
  1046. @end menu
  1047. '],
  1048. ['ref_to_unknown_node',
  1049. '@xref{unknown node}.'],
  1050. ['raiselowersections',
  1051. '\input texinfo @c -*-texinfo-*-
  1052. @node Top
  1053. @top
  1054. @menu
  1055. * Chapter::
  1056. * Second chapter::
  1057. @end menu
  1058. @node Chapter
  1059. @chapter Chapter
  1060. @menu
  1061. @ifclear include
  1062. * Chapter in included file::
  1063. @end ifclear
  1064. @end menu
  1065. @set do-top
  1066. @lowersections
  1067. @ifclear include
  1068. @include section_file.texi
  1069. @end ifclear
  1070. @raisesections
  1071. @clear do-top
  1072. @node Second chapter
  1073. @chapter Second chapter
  1074. Second chapter
  1075. @contents
  1076. @bye
  1077. '],
  1078. ['empty_node',
  1079. '@node
  1080. @node , next, prev, up
  1081. '],
  1082. ['empty_anchor',
  1083. '@anchor{}.
  1084. @anchor{ }.
  1085. '],
  1086. ['double_top_in_menu',
  1087. '@node ToP, top
  1088. Top node
  1089. @menu
  1090. * top::
  1091. * TOP:: myself
  1092. @end menu
  1093. @node top,,ToP,Top
  1094. second node.
  1095. '],
  1096. ['rec_nodes',
  1097. '@node Top
  1098. Top node
  1099. @menu
  1100. * second node::
  1101. * node following second::
  1102. @end menu
  1103. @node second node,,Top,Top
  1104. @menu
  1105. * other node::
  1106. * second node::
  1107. @end menu
  1108. @node other node,,,second node
  1109. @menu
  1110. * other node::
  1111. @end menu
  1112. @node node up node following second,,,node following second
  1113. @menu
  1114. * node following second::
  1115. @end menu
  1116. in node up node following second
  1117. @node node following second,,,node up node following second
  1118. in node following second
  1119. @menu
  1120. * node up node following second::
  1121. @end menu
  1122. '],
  1123. ['semi_auto',
  1124. '@node Top
  1125. @top Top
  1126. @menu
  1127. * Chap1::
  1128. * Section non auto::
  1129. @end menu
  1130. @node Chap1
  1131. @chapter Chapter 1
  1132. @menu
  1133. * Sec in chapter::
  1134. @end menu
  1135. @node Sec in chapter
  1136. @section Sec in chapter
  1137. @node Section non auto,, Chap1, Top
  1138. @section Section
  1139. '],
  1140. ['next_no_prev_to_node',
  1141. '@node Top
  1142. @menu
  1143. * first node::
  1144. * no return::
  1145. @end menu
  1146. @node first node, no return,, Top
  1147. @node no return,,, Top
  1148. '],
  1149. ['novalidate',
  1150. '
  1151. @novalidate
  1152. @node first, unknown node
  1153. @menu
  1154. * not a node::
  1155. @end menu
  1156. @xref{unknown ref}.
  1157. '],
  1158. ['loop_nodes',
  1159. '
  1160. @node Top
  1161. @top top
  1162. @menu
  1163. * node up::
  1164. @end menu
  1165. @node node up,,,node down
  1166. @menu
  1167. * node middle::
  1168. @end menu
  1169. @node node middle,,,node up
  1170. @menu
  1171. * node down::
  1172. @end menu
  1173. @node node down
  1174. '],
  1175. ['complex',
  1176. $complex_case,
  1177. {'test_split' => 'section'}
  1178. ],
  1179. ['complex_split_at_node',
  1180. $complex_case,
  1181. {'test_split' => 'node'}
  1182. ],
  1183. ['double_top_section',
  1184. '@top First top
  1185. First top.
  1186. @top Second top
  1187. Second top.
  1188. '],
  1189. ['unnumbered_before_top',
  1190. '@unnumbered before top
  1191. @top top
  1192. '],
  1193. ['hole_in_sectioning',
  1194. '@top Top
  1195. @chapter Chapter
  1196. @section section
  1197. @subsubsection subsubsection with no subsection above
  1198. @subsection the subsection
  1199. '],
  1200. ['lone_Top_node',
  1201. '@node Top
  1202. @menu
  1203. * First::
  1204. @end menu
  1205. @node First
  1206. @chapter chap
  1207. ', {'test_split' => 'section'}
  1208. ],
  1209. ['lowered_subsubsection',
  1210. '@node Top
  1211. @top
  1212. @menu
  1213. * Chapter::
  1214. @end menu
  1215. @node Chapter
  1216. @chapter Chapter
  1217. @menu
  1218. * Section::
  1219. @end menu
  1220. @node Section
  1221. @section Section
  1222. @menu
  1223. * Subsection::
  1224. @end menu
  1225. @node Subsection
  1226. @subsection Subsection
  1227. @menu
  1228. * Subsubsection::
  1229. * Lowered subsec::
  1230. @end menu
  1231. @node Subsubsection
  1232. @subsubsection Subsubsection
  1233. @lowersections
  1234. @node Lowered subsec
  1235. @subsection Lowered subsec
  1236. @menu
  1237. * Lowered subsubsection::
  1238. @end menu
  1239. @node Lowered subsubsection
  1240. @subsubsection Lowered subsubsection
  1241. @raisesections
  1242. @contents
  1243. @bye
  1244. '],
  1245. ['loweredheading',
  1246. '@lowersections
  1247. @section Foo
  1248. @heading Bar
  1249. @bye
  1250. '],
  1251. ['menutextorder',
  1252. '@menu
  1253. * foo::
  1254. * bar::
  1255. @end menu
  1256. @node bar
  1257. @chapter bar
  1258. @menu
  1259. * onesub2::
  1260. @end menu
  1261. @node onesub1
  1262. @section One sub 1
  1263. @node onesub2
  1264. @section One sub 2
  1265. @node foo
  1266. @chapter foo
  1267. @menu
  1268. * sub1::
  1269. * sub3::
  1270. * sub2::
  1271. @end menu
  1272. @node sub1
  1273. @section Sub1
  1274. @node sub2
  1275. @section Sub2
  1276. @node sub3
  1277. @section Sub3
  1278. '],
  1279. ['nodes_before_top',
  1280. '@node first, Top, ,(dir)
  1281. @menu
  1282. * node in menu before top::
  1283. @end menu
  1284. @node node in menu before top,,,first
  1285. @node Top,,first
  1286. @top top section
  1287. @menu
  1288. * second node::
  1289. @end menu
  1290. @node second node
  1291. @chapter a chapter
  1292. '],
  1293. ['part_before_section',
  1294. '@part part
  1295. @section section
  1296. ', {'test_split' => 'section', 'test_formats' => ['html_text']}
  1297. ],
  1298. ['section_before_chapter',
  1299. '@section section
  1300. @chapter chapter
  1301. '],
  1302. ['top_part_chapter',
  1303. '@top top
  1304. @part part
  1305. @chapter chapter
  1306. ', {'test_split' => 'section'}],
  1307. ['section_before_top_no_node',
  1308. '@section section
  1309. @top top
  1310. '],
  1311. ['section_chapter_before_top',
  1312. '@section section
  1313. @chapter chapter
  1314. @top top
  1315. '],
  1316. ['part_chapter_appendix',
  1317. '
  1318. @part Part 1
  1319. @chapter chapter
  1320. @appendix Appendix
  1321. '],
  1322. ['sectioning_part_appendix',
  1323. $test_text,
  1324. {'test_split' => 'section'}],
  1325. ['sectioning_part_appendix_no_top',
  1326. $sections_no_top_text,
  1327. {'test_split' => 'section'}],
  1328. ['chapter_sections',
  1329. $chapter_sections_text,
  1330. {'test_split' => 'section'}],
  1331. ['top_chapter_sections',
  1332. $top_chapter_sections_text,
  1333. {'test_split' => 'section'}],
  1334. ['contents_in_html_text',
  1335. '@top top
  1336. @chapter Chap1
  1337. @section Sec 1
  1338. @chapter Chap2
  1339. @shortcontents
  1340. @contents
  1341. ', {'test_formats' => ['html_text']}
  1342. ],
  1343. ['more_sections_than_nodes',
  1344. '@node Top
  1345. @top top
  1346. @menu
  1347. * n c2::
  1348. * n c3::
  1349. * n c3 s1 s2::
  1350. @end menu
  1351. @chapter c1
  1352. @node n c2
  1353. @chapter c2
  1354. @section s1
  1355. @node n c3, n c3 s1 s2, n c2, Top
  1356. @chapter c3
  1357. @menu
  1358. * n c3 s 2::
  1359. @end menu
  1360. @section C3 s1
  1361. @node n c3 s 2
  1362. @section c3 s2
  1363. @section c3 s3
  1364. @chapter c4
  1365. @section c3 s1
  1366. @subsection c3 s1 s1
  1367. @node n c3 s1 s2,,n c3,Top
  1368. @subsection c3 s1 s2
  1369. @appendix appendix
  1370. '],
  1371. ['empty_ref_arg',
  1372. '@node Top
  1373. @ref{Top, @ }
  1374. @ref{Top, , @ }
  1375. @ref{Top, @ , @:}
  1376. @ref{Top, @c aaa
  1377. @
  1378. @c ggg
  1379. , @c fff
  1380. @c
  1381. }
  1382. '
  1383. ],
  1384. ['no_menu',
  1385. '@node Top
  1386. @top
  1387. @node c1
  1388. @chapter c1
  1389. @node c2
  1390. @chapter c2
  1391. @node c3
  1392. @chapter c3
  1393. ', {'test_formats' => ['info', 'html']}
  1394. ],
  1395. ['contents_at_document_begin',
  1396. undef, {'test_file' => 'contents_at_document_begin.texi'}],
  1397. ['contents_at_end_document_after_node',
  1398. undef, {'test_file' => 'contents_at_end_document_after_node.texi'}],
  1399. ['contents_at_end_document',
  1400. undef, {'test_file' => 'contents_at_end_document.texi'}],
  1401. ['contents_in_document',
  1402. undef, {'test_file' => 'contents_in_document.texi'}],
  1403. ['contents_no_section',
  1404. undef, {'test_file' => 'contents_no_section.texi'}],
  1405. );
  1406. my @test_out_files = (
  1407. ['transliterated_split_equivalent_nodes',
  1408. '@node Top
  1409. @menu
  1410. * @~a::
  1411. * n::
  1412. * @^a::
  1413. @end menu
  1414. @node @~a
  1415. @node n
  1416. @node @^a
  1417. ', {'test_split' => 'node'}],
  1418. ['character_and_spaces_in_refs_out',
  1419. $character_and_spaces_in_refs_text,
  1420. {'test_split' => 'node'}]
  1421. );
  1422. foreach my $test (@test_out_files) {
  1423. push @{$test->[2]->{'test_formats'}}, 'file_html';
  1424. $test->[2]->{'test_input_file_name'} = $test->[0] . '.texi';
  1425. }
  1426. my @xml_tests_converted_tests = ('section_before_part', 'chapter_before_part',
  1427. 'part_before_top', 'double_part', 'section_in_unnumbered_plaintext',
  1428. 'two_unnumbered_no_argument', 'two_nodes_between_chapters',
  1429. 'chapter_before_and_after_part');
  1430. foreach my $test (@tests_converted) {
  1431. push @{$test->[2]->{'test_formats'}}, 'plaintext';
  1432. push @{$test->[2]->{'test_formats'}}, 'html';
  1433. push @{$test->[2]->{'test_formats'}}, 'xml'
  1434. if (grep {$_ eq $test->[0]} @xml_tests_converted_tests);
  1435. }
  1436. my @xml_tests_info_tests = ('part_chapter_after_top',
  1437. 'part_node_after_top', 'part_node_before_top',
  1438. 'chapter_between_nodes', 'nodes_no_node_top_explicit_directions',
  1439. 'part_node_chapter_after_top', 'node_part_chapter_after_top',
  1440. 'node_part_chapter_after_chapter', 'section_before_top',
  1441. 'section_node_before_part', 'top_node_part_top',
  1442. 'chapter_node_before_and_after_part',
  1443. 'more_nodes_than_sections', 'part_node_chapter_appendix',
  1444. 'part_node_part_appendix', 'part_node_chapter_node_appendix',
  1445. 'part_node_part_node_appendix', 'part_node_node_part_appendix',
  1446. 'explicit_node_directions', 'nodes_after_top_before_chapter_nodes',
  1447. 'double_node_anchor_float');
  1448. my @docbook_tests_info_tests = ('double_node_anchor_float');
  1449. foreach my $test (@tests_info) {
  1450. push @{$test->[2]->{'test_formats'}}, 'info';
  1451. push @{$test->[2]->{'test_formats'}}, 'html';
  1452. push @{$test->[2]->{'test_formats'}}, 'xml'
  1453. if (grep {$_ eq $test->[0]} @xml_tests_info_tests);
  1454. push @{$test->[2]->{'test_formats'}}, 'docbook'
  1455. if (grep {$_ eq $test->[0]} @docbook_tests_info_tests);
  1456. }
  1457. my @xml_tests_cases_tests = ('part_before_section',
  1458. 'section_before_chapter',
  1459. 'top_part_chapter', 'section_before_top_no_node',
  1460. 'section_chapter_before_top', 'sectioning_part_appendix',
  1461. 'part_chapter_appendix', 'sectioning_part_appendix_no_top',
  1462. 'top_chapter_sections', 'chapter_sections',
  1463. 'more_sections_than_nodes');
  1464. foreach my $test (@test_cases) {
  1465. push @{$test->[2]->{'test_formats'}}, 'xml'
  1466. if (grep {$_ eq $test->[0]} @xml_tests_cases_tests);
  1467. }
  1468. our ($arg_test_case, $arg_generate, $arg_debug);
  1469. run_all ('sectioning', [@test_cases, @tests_converted,
  1470. @test_out_files, @tests_info], $arg_test_case,
  1471. $arg_generate, $arg_debug);