18itemize.t 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  1. use strict;
  2. use File::Spec;
  3. BEGIN { if (defined($ENV{'top_srcdir'})) {unshift @INC, File::Spec->catdir($ENV{'top_srcdir'}, 'tp');} }
  4. require 't/test_utils.pl';
  5. my @test_cases = (
  6. ['w_argument',
  7. '@itemize @w{}
  8. @item @option{--build=} platform on which the program is compiled,
  9. @item @option{--target=} target platform on which the program is processed.
  10. @end itemize
  11. '],
  12. # unclear that these are valid constructs...
  13. ['accent_argument',
  14. '@itemize @~@comment
  15. @item item
  16. @end itemize
  17. @itemize @~
  18. @item item
  19. @end itemize
  20. '],
  21. ['comment_first_on_itemize_line',
  22. '@itemize @c comment on itemize line
  23. @item first
  24. @end itemize
  25. '],
  26. ['enumerate_argument',
  27. '@enumerate 1
  28. @end enumerate
  29. @enumerate A@c comment
  30. @end enumerate
  31. @enumerate z @c comment
  32. @end enumerate
  33. '],
  34. ['enumerate_argument_item',
  35. '@enumerate 1
  36. @item numeric first
  37. @item numeric second
  38. @end enumerate
  39. @enumerate A@c comment
  40. @item upper case first
  41. @item upper case second
  42. @end enumerate
  43. @enumerate z @c comment
  44. @item lower case first
  45. @item lower case second
  46. @end enumerate
  47. '],
  48. ['comment_first_on_enumerate_line',
  49. '@enumerate @c comment on enumerate line
  50. @item first
  51. @end enumerate
  52. '],
  53. ['enumerate_letters',
  54. '@enumerate c
  55. @item aaa
  56. @item aaa
  57. @item aaa
  58. @item aaa
  59. @item aaa
  60. @item aaa
  61. @item aaa
  62. @item aaa
  63. @item aaa
  64. @item aaa
  65. @item aaa
  66. @item aaa
  67. @item aaa
  68. @item aaa
  69. @item aaa
  70. @item aaa
  71. @item aaa
  72. @item aaa
  73. @item aaa
  74. @item aaa
  75. @item aaa
  76. @item aaa
  77. @item aaa
  78. @item aaa
  79. @item aaa
  80. @item aaa
  81. @item aaa
  82. @item aaa
  83. @item aaa
  84. @item aaa
  85. @item aaa
  86. @item aaa
  87. @item aaa
  88. @item aaa
  89. @item aaa
  90. @item aaa
  91. @item aaa
  92. @item aaa
  93. @item aaa
  94. @item aaa
  95. @item aaa
  96. @item aaa
  97. @item aaa
  98. @item aaa
  99. @item aaa
  100. @item aaa
  101. @item aaa
  102. @item aaa
  103. @item aaa
  104. @item aaa
  105. @item aaa
  106. @item aaa
  107. @item aaa
  108. @item aaa
  109. @item aaa
  110. @item aaa
  111. @item aaa
  112. @item aaa
  113. @item aaa
  114. @item aaa
  115. @item aaa
  116. @item aaa
  117. @item aaa
  118. @item aaa
  119. @item aaa
  120. @item aaa
  121. @item aaa
  122. @item aaa
  123. @item aaa
  124. @item aaa
  125. @item aaa
  126. @item aaa
  127. @item aaa
  128. @item aaa
  129. @item aaa
  130. @item aaa
  131. @item aaa
  132. @item aaa
  133. @item aaa
  134. @item aaa
  135. @item aaa
  136. @item aaa
  137. @item aaa
  138. @item aaa
  139. @item aaa
  140. @item aaa
  141. @item aaa
  142. @item aaa
  143. @item aaa
  144. @item aaa
  145. @item aaa
  146. @item aaa
  147. @item aaa
  148. @item aaa
  149. @item aaa
  150. @item aaa
  151. @item aaa
  152. @item aaa
  153. @item aaa
  154. @item aaa
  155. @item aaa
  156. @item aaa
  157. @item aaa
  158. @item aaa
  159. @item aaa
  160. @item aaa
  161. @item aaa
  162. @item aaa
  163. @item aaa
  164. @item aaa
  165. @item aaa
  166. @item aaa
  167. @item aaa
  168. @item aaa
  169. @item aaa
  170. @item aaa
  171. @item aaa
  172. @item aaa
  173. @item aaa
  174. @item aaa
  175. @item aaa
  176. @item aaa
  177. @item aaa
  178. @item aaa
  179. @item aaa
  180. @item aaa
  181. @item aaa
  182. @item aaa
  183. @item aaa
  184. @item aaa
  185. @item aaa
  186. @item aaa
  187. @item aaa
  188. @item aaa
  189. @item aaa
  190. @item aaa
  191. @item aaa
  192. @item aaa
  193. @item aaa
  194. @item aaa
  195. @item aaa
  196. @item aaa
  197. @item aaa
  198. @item aaa
  199. @item aaa
  200. @item aaa
  201. @item aaa
  202. @item aaa
  203. @item aaa
  204. @item aaa
  205. @item aaa
  206. @item aaa
  207. @item aaa
  208. @item aaa
  209. @item aaa
  210. @item aaa
  211. @item aaa
  212. @item aaa
  213. @item aaa
  214. @item aaa
  215. @item aaa
  216. @item aaa
  217. @item aaa
  218. @item aaa
  219. @item aaa
  220. @item aaa
  221. @item aaa
  222. @item aaa
  223. @item aaa
  224. @item aaa
  225. @item aaa
  226. @item aaa
  227. @item aaa
  228. @item aaa
  229. @item aaa
  230. @item aaa
  231. @item aaa
  232. @item aaa
  233. @item aaa
  234. @item aaa
  235. @item aaa
  236. @item aaa
  237. @item aaa
  238. @item aaa
  239. @item aaa
  240. @item aaa
  241. @item aaa
  242. @item aaa
  243. @item aaa
  244. @item aaa
  245. @item aaa
  246. @item aaa
  247. @item aaa
  248. @item aaa
  249. @item aaa
  250. @item aaa
  251. @item aaa
  252. @item aaa
  253. @item aaa
  254. @item aaa
  255. @item aaa
  256. @item aaa
  257. @item aaa
  258. @item aaa
  259. @item aaa
  260. @item aaa
  261. @end enumerate
  262. '],
  263. ['enumerate_in_example',
  264. '
  265. @example
  266. @enumerate
  267. @item first item
  268. @item second item
  269. still second
  270. @end enumerate
  271. @end example
  272. '],
  273. ['itemize_and_empty_lines',
  274. '@itemize youhou
  275. @item first item
  276. @item
  277. @example
  278. In example
  279. end example.
  280. @end example
  281. @item
  282. empty line.
  283. @item
  284. @example
  285. In second example
  286. @end example
  287. @quotation
  288. Quotation
  289. @end quotation
  290. @item
  291. @quotation
  292. quotation after a blank line
  293. @end quotation
  294. @end itemize
  295. @itemize
  296. @item first item
  297. @item
  298. @example
  299. In example
  300. end example.
  301. @end example
  302. @item
  303. empty line.
  304. @item
  305. @example
  306. In second example
  307. @end example
  308. @item
  309. @quotation
  310. Quotation
  311. @end quotation
  312. @item
  313. @quotation
  314. quotation after a blank line
  315. @end quotation
  316. @end itemize
  317. An itemize
  318. @itemize @minus
  319. @item truc
  320. line
  321. @end itemize
  322. After itemize
  323. A nested itemize
  324. @itemize @minus
  325. @item truc
  326. line
  327. @itemize @bullet
  328. @item in nested itemize
  329. @end itemize
  330. After inside nested itemize.
  331. @end itemize
  332. After nested itemize
  333. @itemize @bullet
  334. @item the version number of Texinfo and the program(s) or manual(s) involved.
  335. @item hardware and operating system names and versions.
  336. @item something aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaa
  337. b b bbbbbbbbbbbbbbbbbbbbbbb.
  338. @end itemize
  339. '],
  340. ['itemize_long_item',
  341. '@itemize youhou itemize very long item aaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbb cccccccccccc
  342. @item first item
  343. @item
  344. @example
  345. In example
  346. end example.
  347. @end example
  348. @item
  349. empty line.
  350. @item
  351. @example
  352. In second example
  353. @end example
  354. @item
  355. @quotation
  356. Quotation
  357. @end quotation
  358. @item
  359. @quotation
  360. quotation after a blank line
  361. @end quotation
  362. @end itemize
  363. '],
  364. ['enumerate_and_empty_lines',
  365. '@enumerate
  366. @item first item
  367. @item
  368. @example
  369. In example
  370. end example.
  371. @end example
  372. @item
  373. empty line.
  374. @item
  375. @example
  376. In second example
  377. @end example
  378. @item
  379. @quotation
  380. Quotation
  381. @end quotation
  382. @item
  383. @quotation
  384. quotation after a blank line
  385. @end quotation
  386. @end enumerate
  387. @enumerate
  388. @item aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa fffffffff ggggggggg vvvvvvvvv ggggggggg h
  389. @end enumerate
  390. '],
  391. ['itemize_line_commands_with_brace',
  392. '@itemize @bullet{}
  393. @item bullet
  394. @end itemize
  395. @itemize @minus{}
  396. @item minus
  397. @end itemize
  398. '],
  399. ['asis_as_itemize_argument',
  400. '@itemize @asis
  401. @item as is
  402. @end itemize
  403. '],
  404. ['itemize_in_example',
  405. '@example
  406. @itemize @bullet
  407. @item first
  408. more.
  409. @end itemize
  410. @itemize @asis
  411. @item as is
  412. @end itemize
  413. @itemize +
  414. @item item +
  415. @end itemize
  416. @itemize @bullet{} a--n itemize line
  417. @item in an itemize line
  418. @end itemize
  419. @end example
  420. '],
  421. ['inter_item_commands_in_itemize',
  422. '@itemize @minus
  423. @c comment in itemize
  424. @cindex also a cindex in itemize
  425. @item e--mph item
  426. @end itemize
  427. @itemize @bullet
  428. @cindex index entry within itemize
  429. @item i--tem 1
  430. @item @cindex index entry right after @@item
  431. i--tem 2
  432. @end itemize
  433. @itemize
  434. @c comment in itemize
  435. T--ext before items.
  436. @cindex also a cindex in itemize
  437. @item bullet item
  438. @end itemize
  439. '],
  440. ['inter_item_commands_in_enumerate',
  441. '@enumerate
  442. @comment comment before first item in enumerate
  443. @item e--numerate
  444. @end enumerate
  445. @enumerate
  446. Title
  447. @cindex cindex
  448. @item enum
  449. @end enumerate
  450. '],
  451. );
  452. my @test_invalid = (
  453. ['not_closed_item',
  454. '@itemize
  455. @item in item
  456. '],
  457. ['not_closed_itemize',
  458. '@itemize
  459. '],
  460. ['lone_end_itemize',
  461. '@end itemize
  462. '],
  463. ['headitem_itemx_in_itemize',
  464. '@itemize
  465. @item item
  466. @itemx itemx
  467. @headitem headitem
  468. @end itemize
  469. '],
  470. ['headitem_itemx_in_enumerate',
  471. '@enumerate
  472. @item item enumerate
  473. @itemx itemx enumerate
  474. @headitem headitem enumerate
  475. @end enumerate
  476. '],
  477. ['bad_enumerate_arguments',
  478. '@enumerate a b
  479. @end enumerate
  480. @enumerate !
  481. @end enumerate
  482. @enumerate @code{a}
  483. @end enumerate
  484. @enumerate a@@
  485. @end enumerate
  486. @enumerate a0
  487. @end enumerate
  488. '],
  489. );
  490. foreach my $test (@test_cases) {
  491. push @{$test->[2]->{'test_formats'}}, 'plaintext';
  492. push @{$test->[2]->{'test_formats'}}, 'html_text';
  493. }
  494. our ($arg_test_case, $arg_generate, $arg_debug);
  495. run_all ('itemize', [@test_cases, @test_invalid], $arg_test_case,
  496. $arg_generate, $arg_debug);