plaintext_tests.t 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005
  1. # $Id$
  2. use strict;
  3. use File::Spec;
  4. BEGIN { if (defined($ENV{'top_srcdir'})) {unshift @INC, File::Spec->catdir($ENV{'top_srcdir'}, 'tp');} }
  5. require 't/test_utils.pl';
  6. my @test_cases = (
  7. ['settitle_and_empty_top',
  8. '@settitle Title
  9. @top
  10. '],
  11. ['anchor_and_empty_lines',
  12. 'text 1.
  13. @anchor{in anchor}
  14. text 2.
  15. '],
  16. ['long_line',
  17. 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  18. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA BBBBBBBBBBBBB
  19. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
  20. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaaa BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBb
  21. 1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA BBBBB
  22. 2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA BBBBB
  23. 3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA BBBBB
  24. 4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA BBBBB
  25. 5AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA BBBBB
  26. 6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA BBBBB
  27. 7AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA BBBBB
  28. 8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA BBBBB
  29. 9AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA BBBBB
  30. 10AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA BBBBB
  31. 11AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA BBBBB
  32. '],
  33. ['commands_and_punctuation',
  34. 'SomthingA@. and now inhibit.@: Now dots @dots{} and enddots @enddots{} and'],
  35. ['inhibit_punctuation',
  36. 'foo vs.@: bar.
  37. colon :@:And something else.
  38. semi colon ;@:.
  39. And ? ?@:. ?@:
  40. Now ! !@:@@ !@:
  41. but , ,@:
  42. '],
  43. ['punctuation_in_sc', 'one @sc{two.} three @sc{FOUR.} five'],
  44. ['accent_command_punctuation',
  45. '@dotaccent{e} after'],
  46. ['empty_line_in_example_end',
  47. '@example
  48. in example
  49. @end example
  50. After line
  51. '],
  52. ['protected_space_end_line',
  53. 'First para
  54. This is a very simple texi manual followed by tab a <>.
  55. followed by @ @ newline.
  56. This is a very simple texi manual followed by tab a <>.
  57. followed @ @ @ newline.
  58. This is a very simple texi manual followed by tab a <>. @ @ @ @ @ @ @ @ @ @
  59. text.
  60. '],
  61. ['end_sentence_space_protected',
  62. 'Some text. @
  63. Next sentence.
  64. '],
  65. ['protect_spaces_on_line',
  66. '
  67. Before samp. @samp{a}. after samp, w @w{in w. after dot} afterw
  68. @quotation
  69. @exdent before samp. @samp{a}. after samp, w @w{in w. after dot} afterw
  70. @end quotation
  71. '],
  72. ['html_expanded',
  73. 'Before
  74. @html
  75. html
  76. @end html
  77. after.
  78. ',{'expanded_formats' => ['html']}, {'expanded_formats' => ['html']}
  79. ],
  80. ['isolated_html_expanded',
  81. '
  82. @html
  83. html
  84. @end html
  85. ',{'expanded_formats' => ['html']}, {'expanded_formats' => ['html']}
  86. ],
  87. ['star_at_command_formatting',
  88. '@macro mymacro
  89. Some text @*
  90. more text. @
  91. Even more text. @* not at eol.
  92. Now followed by @@ : followed@*@
  93. And now followed by a space and @@ : follow @* @
  94. And now followed by a space and @@ and text: follow @* @ text
  95. Followed by empty asis and a space @asis{}
  96. Followed by asis with space and a space @asis{ }
  97. And now with * empty @@asis: @*@asis{}
  98. And now with * asis with space @@asis: @* @asis{ }
  99. And end para.
  100. @end macro
  101. @mymacro{}
  102. @example
  103. Example
  104. @mymacro{}
  105. @end example
  106. @quotation
  107. Quotation
  108. @mymacro{}
  109. @end quotation
  110. '],
  111. ['line_passed_and_formats',
  112. '@node Top
  113. @quotation special
  114. Quotation special.
  115. @quotation
  116. Nested quotation sdflkmsfdlkmfsdqmlkfsdq mlfdsqlkmfdsqmlkfdsq klm fsqdlkmfdsq
  117. fdsfsdqmlkfsqd m lqlkmf qskmlfq sklm fqds
  118. @end quotation
  119. @end quotation
  120. @quotation
  121. quotation text
  122. @example
  123. example in quotation
  124. @end example
  125. @end quotation
  126. @example
  127. In example.
  128. @quotation
  129. In quotation in example
  130. @end quotation
  131. @end example
  132. @example
  133. In 1 example
  134. @end example
  135. @example
  136. In 2 example
  137. @end example
  138. @quotation
  139. In 1 quotation
  140. @end quotation
  141. @quotation
  142. In 2 quotation
  143. @end quotation
  144. @quotation
  145. Quotation
  146. @quotation
  147. Nested quotation
  148. @end quotation
  149. Quotation 2
  150. @end quotation
  151. @example
  152. In example.
  153. @quotation
  154. In quotation in example
  155. @end quotation
  156. In example 2.
  157. @end example
  158. @quotation
  159. quotation text
  160. @example
  161. example in quotation
  162. @end example
  163. quotation text 2
  164. @end quotation
  165. Before quotation
  166. @quotation
  167. quotation text
  168. @end quotation
  169. after end
  170. Before example
  171. @example
  172. In example
  173. @end example
  174. After example
  175. Before quotation and empty line
  176. @quotation
  177. In quotation
  178. @end quotation
  179. After quotation
  180. Before example and empty line
  181. @example
  182. In example
  183. @end example
  184. After example
  185. Nested and empty lines
  186. Quotation empty out, spaces inside
  187. @quotation
  188. @quotation
  189. In nested
  190. @end quotation
  191. @end quotation
  192. Quotation empty out, no spaces inside
  193. @quotation
  194. @quotation
  195. In nested
  196. @end quotation
  197. @end quotation
  198. Example empty out, spaces inside
  199. @example
  200. @example
  201. In nested
  202. @end example
  203. @end example
  204. Example empty out, no spaces inside
  205. @example
  206. @example
  207. In nested
  208. @end example
  209. @end example
  210. menu
  211. @menu
  212. * (manual)node::
  213. @end menu
  214. end menu
  215. '],
  216. ['nested_indentedblock',
  217. '@example
  218. in example
  219. @indentedblock
  220. f f f``g
  221. @end indentedblock
  222. @end example
  223. @indentedblock
  224. v v v``a
  225. @example
  226. in example
  227. @end example
  228. @end indentedblock
  229. '],
  230. ['multitable',
  231. '@multitable {truc} {bidule}
  232. @item truc @tab bidule
  233. @item truc2 @tab bidule2
  234. @end multitable
  235. @multitable {t} {b}
  236. @item AAAAAAAAAAAA @tab BBBBBBBBBBBBBBB
  237. @item A @tab B
  238. @item AA @tab BB
  239. @item AAA @tab BBB
  240. @item AAAA @tab BBBB
  241. @item 1 1 @tab 1 2B
  242. @item 1 3BB @tab 1 4BBB
  243. @item 2A 1 @tab AA AA
  244. @item 2A 3BB @tab 2A 4BBB
  245. @item 3AA 1 @tab 3AA 2B
  246. @item 3AA 3BB @tab 3AA 4BBB
  247. @item 4AAA 1 @tab 4AAA 2B
  248. @item 4AAA 3BB @tab 4AAA 4BBB
  249. @headitem he @tab th
  250. @end multitable
  251. @multitable {AA} {BB}
  252. @item a b @tab AA BB
  253. @item aa b @tab AA B
  254. @item aaa b @tab A BB
  255. @end multitable
  256. @multitable {A}
  257. @item A
  258. B
  259. @item a b
  260. @end multitable
  261. @multitable {A} {B}
  262. @item U
  263. V
  264. @tab u
  265. v
  266. @item a b
  267. @tab A B
  268. @end multitable
  269. '],
  270. ['nested_multitable',
  271. '
  272. @multitable {truc AAAA @ machin} {bidule}
  273. @item
  274. @multitable {AAAA} {machin}
  275. @item AAAA @tab machin
  276. @end multitable
  277. @tab bidule
  278. @item other item @tab in tab
  279. @end multitable
  280. '],
  281. ['empty_multitable_in_itemize',
  282. '@itemize a--n itemize line
  283. @item in macro
  284. @multitable
  285. @end multitable
  286. @end itemize
  287. '],
  288. ['long_uref_after_item',
  289. '@itemize
  290. @item
  291. @uref{http://foo.org/some/long/url/which/goes/past/eighty/columns/and/has/no/alternative/text.html}
  292. @end itemize
  293. '],
  294. ['before_accent_punctuation',
  295. 'a. @^a'],
  296. ['invalid_accent_punctuation',
  297. 'a. @^@@'],
  298. ['punctuation_in_command',
  299. '
  300. Text. Email @email{a. b,a. b} dmn @dmn{1. 2} and text. indicateurl @indicateurl{i. u} and then kbd @kbd{k. d} and math @math{m. a} and cite @cite{c. e} and emph @emph{e. h} text.
  301. asis in code @code{@asis{a. c}}
  302. '],
  303. ['punctuation_at_end_command',
  304. '
  305. Text. Email @email{.,.} dmn @dmn{1.} and text. indicateurl @indicateurl{.} and
  306. then kbd @kbd{.} and math @math{.} and cite @cite{.} and emph @emph{.} text.
  307. asis in code @code{@asis{.}} text. a dot before a emph open .@emph{ and in emph.}
  308. '],
  309. ['punctuation_in_command_end_line',
  310. 'Text. Email @email{.,.}
  311. dmn @dmn{1.}
  312. and text. indicateurl @indicateurl{.}
  313. and then kbd @kbd{.}
  314. and math @math{.}
  315. and cite @cite{.}
  316. and emph @emph{.}
  317. text. asis in code @code{@asis{.}}
  318. text. a dot before a emph open .@emph{
  319. and in emph.}
  320. '],
  321. ['after_punctuation_character_in_command',
  322. 'Text.@asis{)
  323. follows}.
  324. '],
  325. ['sc_with_utf8_enable_encoding',
  326. '@documentencoding utf-8
  327. @sc{in sc}.
  328. '],
  329. ['U_with_utf8_enable_encoding',
  330. '@documentencoding utf-8
  331. @U{00FF} (should be a real y-dieresis in UTF-8).
  332. '],
  333. ['flushright_not_closed_and_format',
  334. '@flushright
  335. flushright
  336. @quotation
  337. A quot---ation
  338. @end quotation
  339. '],
  340. ['punctuation_abbr_acronym',
  341. '@abbr{AAA}. @acronym{BBB}. @abbr{aaa}. @acronym{bbb}. Next.
  342. @abbr{AAA, expL}. @acronym{BBB, explA}. @abbr{aaa, expl}.
  343. @acronym{bbb, expla}. Last.
  344. '],
  345. ['punctuation_and_upper_case_commands',
  346. '
  347. @var{aaa}. @var{@~e}. @var{@aa{}}.
  348. @var{AAA}. @var{@~E}. @var{@AA{}}.
  349. @var{double AAA}. @var{double @~E}. @var{double @AA{}}. End.
  350. @sc{aaa}. @sc{@~e}. @sc{@aa{}}.
  351. @sc{AAA}. @sc{@~E}. @sc{@AA{}}.
  352. @sc{double AAA}. @sc{double @~E}. @sc{double @AA{}}. End.
  353. '],
  354. ['punctuation_and_upper_case_commands_utf8',
  355. '@documentencoding utf-8
  356. @var{aaa}. @var{@~e}. @var{@aa{}}.
  357. @var{AAA}. @var{@~E}. @var{@AA{}}.
  358. @var{double AAA}. @var{double @~E}. @var{double @AA{}}. End.
  359. @sc{aaa}. @sc{@~e}. @sc{@aa{}}.
  360. @sc{AAA}. @sc{@~E}. @sc{@AA{}}.
  361. @sc{double AAA}. @sc{double @~E}. @sc{double @AA{}}. End.
  362. '],
  363. ['punctuation_and_code_style_commands',
  364. '@command{aaa}. @code{@~e}. @samp{@aa{}}.
  365. @command{AAA}. @code{@~E}. @samp{@AA{}}.
  366. @command{double AAA}. @code{double @~E}. @samp{double @AA{}}. End.
  367. '],
  368. ['punctuation_and_code_style_commands_utf8',
  369. '@documentencoding utf-8
  370. @command{aaa}. @code{@~e}. @samp{@aa{}}.
  371. @command{AAA}. @code{@~E}. @samp{@AA{}}.
  372. @command{double AAA}. @code{double @~E}. @samp{double @AA{}}. End.
  373. '],
  374. ['characters_and_commands_in_var',
  375. '@var{aaa}. @var{dlksfjf ) }. @var{(fdfdsfsd}. @var{sqdq,qdsdsq}.
  376. @var{somethingf @c ]
  377. vvar}.
  378. @var{AA@,c @u{r} @`e @aa{}}.
  379. AAA@footnote{jdhfmqsdf
  380. dsf
  381. ds @var{rrrr , azeeaz}
  382. end footnote}
  383. '],
  384. ['transparent_text',
  385. 'AA@footnote{in footnote}). B (@emph{C}). D.
  386. '],
  387. ['accents_in_var_enable_encoding',
  388. '@documentencoding utf-8
  389. @var{AA@,c @u{r} @`e}.
  390. '],
  391. ['command_brace_no_arg_punctuation',
  392. '@TeX{}. And @LaTeX{}. @copyright{}. @registeredsymbol{}. End.
  393. '],
  394. ['code_commands_and_punctuation',
  395. '@code{AA}. @samp{aa}. After.
  396. '],
  397. ['sp_with_text_before_in_example',
  398. '
  399. @example
  400. sp@sp 4
  401. text
  402. @end example
  403. '],
  404. ['expanded_tex',
  405. 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  406. @tex
  407. TTT
  408. GGG
  409. HHH
  410. @end tex
  411. bbbbbbbbb1 bbbbbbbbbbb2 bbbbbbbbbb3 bbbbbbbbbbbbbb4.
  412. ', {'expanded_formats' => ['tex']}, {'expanded_formats' => ['tex']}
  413. ],
  414. ['paragraphindent',
  415. 'First
  416. aaa b default
  417. @paragraphindent asis
  418. aaa b asis
  419. @paragraphindent 0
  420. aaa b 0
  421. @paragraphindent 7
  422. aaa b 7
  423. '],
  424. ['no_empty_line_after_section',
  425. 'Text
  426. @top top
  427. Other text
  428. @chapter chap
  429. @c comment
  430. Para
  431. @comment c
  432. @section sec
  433. @uref{url} A.
  434. @sp 3
  435. @section after sp
  436. @indent
  437. Para indented.
  438. '],
  439. ['nested_code_commands',
  440. '@code{aA @kbd{fg}}.
  441. @code{cc @code{gg}}.
  442. @command{in command @kbd{fg}}
  443. @code{in code @command{in command}}
  444. @samp{in samp @code{in code}}
  445. @code{in code @samp{in samp}}
  446. @var{in var @code{in code}}
  447. @code{in code @var{in var}}
  448. @example
  449. @code{in code}
  450. @code{aA @kbd{fg}}
  451. @kbd{hh}
  452. @command{in command @kbd{fg}}
  453. @code{in code @command{in command}}
  454. @samp{in samp @code{in code}}
  455. @code{in code @samp{in samp}}
  456. @var{in var @code{in code}}
  457. @code{in code @var{in var}}
  458. @end example
  459. @display
  460. @kbd{in disp}
  461. @code{aA @kbd{fg}}
  462. @command{in command @kbd{fg}}
  463. @code{in code @command{in command}}
  464. @samp{in samp @code{in code}}
  465. @code{in code @samp{in samp}}
  466. @var{in var @code{in code}}
  467. @code{in code @var{in var}}
  468. @end display
  469. '],
  470. ['multiline_verb_after_space',
  471. 'AA @verb{*aa
  472. bb*}.
  473. '],
  474. ['multitable_in_example_extraneous_tab',
  475. '@example
  476. @multitable a
  477. @item ita @tab tmp
  478. @item secit @tab
  479. @end multitable
  480. @end example
  481. '],
  482. ['itemize_in_headitem_in_example',
  483. '@example
  484. @itemize
  485. @headitem a
  486. @end itemize
  487. @itemize
  488. @item bbb
  489. @headitem ccc
  490. @end itemize
  491. @itemize
  492. @headitem ddd
  493. @item eee
  494. @end itemize
  495. @itemize
  496. @item fff
  497. @headitem ggg
  498. @item hhh
  499. @end itemize
  500. @end example
  501. '],
  502. ['tab_in_table_in_example',
  503. '@example
  504. @table @code
  505. @tab in tab
  506. @item table item
  507. T
  508. @tab other tab
  509. @end table
  510. @end example
  511. '],
  512. ['tab_item_in_example',
  513. '@example
  514. @tab in tab
  515. @item in item
  516. @end example
  517. '],
  518. ['lone_braces_in_inlineraw',
  519. '@inlineraw{plaintext, {truc}}.
  520. '],
  521. # if this test is modified, the corresponding test in t/info_tests.t should
  522. # be changed too
  523. ['multiline_image_and_align',
  524. '@center @image{figure}
  525. @center CCCC @image{figure}
  526. @center fffffffffffffffffffffffffffffffffffffff @image{figure}
  527. @center dddd @image{figure} iiiii
  528. @flushright
  529. AAA
  530. @image{figure}
  531. BBB @image{figure} gggg @image{figure}
  532. HHH
  533. @image{figure} JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ
  534. @end flushright
  535. '],
  536. );
  537. my $insert_copying_and_paragraph =
  538. '@copying
  539. In copying.
  540. @end copying
  541. Insertcopying
  542. @insertcopying
  543. ';
  544. push @test_cases, ['insert_copying_and_paragraph',
  545. $insert_copying_and_paragraph];
  546. push @test_cases, ['insert_copying_inline_and_paragraph',
  547. $insert_copying_and_paragraph,
  548. {'INLINE_INSERTCOPYING' => 1}];
  549. my $at_commands_glued_text = 'at@@.
  550. TeX@TeX{}TeX.
  551. code@code{in code}code.
  552. acronym@acronym{ABC, aaa bb cc}acronym.
  553. acronym2@acronym{ABC}acronym.
  554. email@email{somebody, mali}email.
  555. ref@ref{Top}ref.
  556. Foornote@footnote{in footnote}after footnote.
  557. accent@^{@dotless{i}}accent.
  558. and star@*star.
  559. noindent@noindent after noindent
  560. sp@sp 4
  561. anchor@anchor{anchor}anchor
  562. index@cindex index
  563. ';
  564. my @at_commands_glued_tests = (
  565. ['at_commands_glued_in_paragraph',
  566. $at_commands_glued_text
  567. ],
  568. ['at_commands_glued_in_example',
  569. '@example'."\n".$at_commands_glued_text.'@end example'."\n"],
  570. );
  571. push @test_cases, @at_commands_glued_tests;
  572. my $punctuation_text = '
  573. Dot. Exclam! Question? Dot. Exclam! Question? GAAA.
  574. End of lines Dot.
  575. Exclam!
  576. Question?
  577. End.
  578. End of lines and spaces
  579. Dot.
  580. Exclam!
  581. Question?
  582. End.
  583. With paren.) paren.) Symb.)"\'] Symb.)"\'] End.
  584. End of lines paren.)
  585. Symb.)"\']
  586. End.
  587. End of lines and spaces paren.)
  588. Symb.)"\']
  589. End.
  590. ';
  591. push @test_cases, (
  592. ['punctuation',
  593. $punctuation_text
  594. ],
  595. ['punctuation_frenchspacing',
  596. '@frenchspacing on'."\n".$punctuation_text],
  597. );
  598. my $punctuation_commands_text = '
  599. Dot@. Exclam@! Question@? Dot@. Exclam@! Question@? GAAA.
  600. Enddots@enddots{} Enddots@enddots{} GBBB.
  601. End of lines Dot@.
  602. Exclam@!
  603. Question@?
  604. Enddots@enddots{}
  605. End.
  606. End of lines and spaces
  607. Dot@.
  608. Exclam@!
  609. Question@?
  610. Enddots@enddots{}
  611. End.
  612. With paren@.) paren@.) Symb@.)"\'] Symb@.)"\'] End.
  613. End of lines paren@.)
  614. Symb@.)"\']
  615. End.
  616. End of lines and spaces paren@.)
  617. Symb@.)"\']
  618. End.
  619. ';
  620. push @test_cases, (
  621. ['punctuation_commands',
  622. $punctuation_commands_text
  623. ],
  624. ['punctuation_commands_frenchspacing',
  625. '@frenchspacing on'."\n".$punctuation_commands_text],
  626. );
  627. my $no_punctuation_commands_text = '
  628. Dot.@: Exclam!@: Question?@: Dot.@: Exclam!@: Question?@: GAAA.
  629. End of lines Dot.@:
  630. Exclam!@:
  631. Question?@:
  632. End.
  633. End of lines and spaces
  634. Dot.@:
  635. Exclam!@:
  636. Question?@:
  637. End.
  638. With paren.@:) paren.@:) Symb.@:)"\'] Symb.@:)"\'] End.
  639. End of lines paren.@:)
  640. Symb.@:)"\']
  641. End.
  642. End of lines and spaces paren.@:)
  643. Symb.@:)"\']
  644. End.
  645. ';
  646. push @test_cases, (
  647. ['no_punctuation_commands',
  648. $no_punctuation_commands_text
  649. ],
  650. ['no_punctuation_commands_frenchspacing',
  651. '@frenchspacing on'."\n".$no_punctuation_commands_text],
  652. );
  653. my $punctuation_and_footnotes_text = '
  654. Text.@footnote{after period} Sentence
  655. end.@footnote{after period double} S2.@footnote{after period triple} S3.
  656. No PERIOD.@footnote{no period} worD.@footnote{no period double} w2
  657. wW.@footnote{no period triple} S3.
  658. Force PERIOD@.@footnote{after forced period} Sentence
  659. W@.@footnote{after forced period double} S2
  660. W@.@footnote{after forced period triple} S3.
  661. Force no period.@:@footnote{after forced no period} Sentence
  662. w.@:@footnote{after forced no period double} S2
  663. w.@:@footnote{after forced no period triple} S3.
  664. ';
  665. push @test_cases, (
  666. ['punctuation_and_footnotes',
  667. $punctuation_and_footnotes_text
  668. ],
  669. ['punctuation_and_footnotes_frenchspacing',
  670. '@frenchspacing on'."\n".$punctuation_and_footnotes_text],
  671. );
  672. my @deep_recursion_tests = (
  673. # more than 100 calls -> perl gives an error message, so those tests are
  674. # disabled for now.
  675. ['deep_recursion_in_formats',
  676. '
  677. @enumerate
  678. @item
  679. @example
  680. @example
  681. @itemize truc
  682. @item
  683. @itemize truc
  684. @item
  685. @itemize truc
  686. @item
  687. @itemize truc
  688. @item
  689. @itemize truc
  690. @item
  691. @itemize truc
  692. @item
  693. @itemize truc
  694. @item
  695. @itemize truc
  696. @item
  697. @itemize truc
  698. @item
  699. @itemize truc
  700. @item
  701. @itemize truc
  702. @item
  703. @itemize truc
  704. @item
  705. @itemize truc
  706. @item
  707. @itemize truc
  708. @item
  709. @itemize truc
  710. @item
  711. @itemize truc
  712. @item
  713. @itemize truc
  714. @item
  715. @itemize truc
  716. @item
  717. @itemize truc
  718. @item
  719. @itemize truc
  720. @item
  721. @itemize truc
  722. @item
  723. @itemize truc
  724. @item
  725. @itemize truc
  726. @item
  727. @itemize truc
  728. @item
  729. @itemize truc
  730. @item
  731. @itemize truc
  732. @item
  733. @itemize truc
  734. @item
  735. @itemize truc
  736. @item
  737. @itemize truc
  738. @item
  739. @itemize truc
  740. @item
  741. @itemize truc
  742. @item
  743. @itemize truc
  744. @item
  745. @itemize truc
  746. @item
  747. @itemize truc
  748. @item
  749. @itemize truc
  750. @item
  751. @itemize truc
  752. @item
  753. @itemize truc
  754. @item
  755. @itemize truc
  756. @item
  757. @itemize truc
  758. @item
  759. @itemize truc
  760. @item
  761. @itemize truc
  762. @item
  763. @itemize truc
  764. @item
  765. @itemize truc
  766. @item
  767. @itemize truc
  768. @item
  769. @itemize truc
  770. @item
  771. @table @asis
  772. @item t
  773. @smallexample
  774. @enumerate
  775. @item
  776. @end enumerate
  777. @end smallexample
  778. @end table
  779. @end itemize
  780. @end itemize
  781. @end itemize
  782. @end itemize
  783. @end itemize
  784. @end itemize
  785. @end itemize
  786. @end itemize
  787. @end itemize
  788. @end itemize
  789. @end itemize
  790. @end itemize
  791. @end itemize
  792. @end itemize
  793. @end itemize
  794. @end itemize
  795. @end itemize
  796. @end itemize
  797. @end itemize
  798. @end itemize
  799. @end itemize
  800. @end itemize
  801. @end itemize
  802. @end itemize
  803. @end itemize
  804. @end itemize
  805. @end itemize
  806. @end itemize
  807. @end itemize
  808. @end itemize
  809. @end itemize
  810. @end itemize
  811. @end itemize
  812. @end itemize
  813. @end itemize
  814. @end itemize
  815. @end itemize
  816. @end itemize
  817. @end itemize
  818. @end itemize
  819. @end itemize
  820. @end itemize
  821. @end itemize
  822. @end itemize
  823. @end itemize
  824. @end example
  825. @end example
  826. @end enumerate
  827. '],
  828. ['deep_recursion_in_brace_commands',
  829. '@code{@samp{@code{@sc{@b{@var{@code{@samp{@code{@sc{@b{@var{
  830. @code{@samp{@code{@sc{@b{@var{@code{@samp{@code{@sc{@b{@var{
  831. @code{@samp{@code{@sc{@b{@var{@code{@samp{@code{@sc{@b{@var{
  832. @code{@samp{@code{@sc{@b{@var{@code{@samp{@code{@sc{@b{@var{
  833. @code{@samp{@code{@sc{@b{@var{@code{@samp{@code{@sc{@b{@var{
  834. }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
  835. '],
  836. );
  837. my @file_tests = (
  838. ['japanese_utf8',
  839. undef, {'test_file' => 'japanese_utf8.texi'}
  840. ],
  841. ['chinese_mixed_with_en',
  842. undef, {'test_file' => 'chinese_mixed_with_en.texi'}
  843. ],
  844. ['non_break_spaces',
  845. undef, {'test_file' => 'non_break_spaces.texi'}
  846. ],
  847. ['all_spaces',
  848. undef, {'test_file' => 'all_spaces.texi',
  849. 'todo' => {'file_plaintext' =>
  850. 'NEL handled differently between perl versions'}}
  851. ],
  852. ['east_asian_in_w',
  853. undef, {'test_file' => 'east_asian_in_w.texi'}
  854. ],
  855. ['quote_node_names',
  856. undef, {'test_file' => 'nodequote.texi',},
  857. {'INFO_SPECIAL_CHARS_QUOTE' => 1,
  858. 'INFO_SPECIAL_CHARS_WARNING' => 0,}
  859. ],
  860. );
  861. foreach my $test (@test_cases) {
  862. $test->[2]->{'test_formats'} = ['plaintext'];
  863. }
  864. foreach my $test (@file_tests) {
  865. $test->[2]->{'test_formats'} = ['file_plaintext'];
  866. }
  867. our ($arg_test_case, $arg_generate, $arg_debug);
  868. run_all ('plaintext_tests', [@test_cases, @file_tests], $arg_test_case,
  869. $arg_generate, $arg_debug);
  870. 1;