25regions.t 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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. ['copying_not_closed',
  7. '@copying
  8. This is a copyright notice
  9. '],
  10. ['double_copying',
  11. '@copying
  12. This is a copyright notice
  13. @copying
  14. And a second one (?)
  15. @end copying
  16. @end copying
  17. '],
  18. ['double_titlepage_not_closed',
  19. '@titlepage
  20. This is in title page
  21. @titlepage
  22. And still in title page
  23. ']
  24. );
  25. my $format_in_titlepage_text = '@titlepage
  26. @format
  27. Published
  28. @end format
  29. @end titlepage
  30. @node Top
  31. ';
  32. my $anchor_in_titlepage_text =
  33. '@titlepage
  34. @anchor{in titlepage}
  35. @end titlepage
  36. @top top
  37. @node Top
  38. @xref{in titlepage}.
  39. ';
  40. my @test_formatted = (
  41. ['anchor_in_copying',
  42. '
  43. @copying
  44. Copying.
  45. @anchor{Copying information}
  46. @end copying
  47. @node Top
  48. @insertcopying
  49. @insertcopying
  50. @xref{Copying information}.
  51. '],
  52. ['anchor_in_copying_in_footnote',
  53. '@copying
  54. Copying@footnote{
  55. In footnote.
  56. @anchor{Copying footnote}
  57. }.
  58. @end copying
  59. @node Top
  60. @insertcopying
  61. @insertcopying
  62. @xref{Copying footnote}.
  63. '],
  64. ['format_in_titlepage',
  65. $format_in_titlepage_text
  66. ],
  67. ['format_in_titlepage_titlepage',
  68. $format_in_titlepage_text, {}, {'USE_TITLEPAGE_FOR_TITLE' => 1}
  69. ],
  70. ['anchor_in_titlepage',
  71. $anchor_in_titlepage_text
  72. ],
  73. ['anchor_in_titlepage_titlepage',
  74. $anchor_in_titlepage_text, {}, {'USE_TITLEPAGE_FOR_TITLE' => 1}
  75. ],
  76. ['ref_in_copying',
  77. '@copying
  78. @ref{GFDL}
  79. @end copying
  80. @node Top
  81. @top top
  82. @insertcopying
  83. @menu
  84. * GFDL::
  85. @end menu
  86. @node GFDL
  87. @chapter GFDL
  88. '],
  89. ['today_in_copying',
  90. '@copying
  91. @today{}.
  92. @end copying
  93. @node Top
  94. @top top
  95. @insertcopying
  96. ',{},{'TEST' => 1}],
  97. );
  98. foreach my $test (@test_formatted) {
  99. push @{$test->[2]->{'test_formats'}}, 'info';
  100. push @{$test->[2]->{'test_formats'}}, 'html';
  101. }
  102. our ($arg_test_case, $arg_generate, $arg_debug);
  103. run_all ('regions', [@test_cases, @test_formatted], $arg_test_case,
  104. $arg_generate, $arg_debug);