123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916 |
- use strict;
- use File::Spec;
- BEGIN { if (defined($ENV{'top_srcdir'})) {unshift @INC, File::Spec->catdir($ENV{'top_srcdir'}, 'tp');} }
- require 't/test_utils.pl';
- my $invalid_node_name_text = '
- @node Top
- @menu
- * @asis{truc:}: @asis{nodename. a}
- * machin: node@comma{}comma, def
- * @asis{bidule:}::
- @end menu
- @node @asis{nodename. a}
- @node node@comma{}comma
- @node @asis{bidule:}
- @ref{@asis{nodename. a}, @asis{truc:}}. @ref{node@comma{}comma, machin}.
- @ref{@asis{bidule:}}.
- ';
- my @test_cases = (
- ['no_nodes',
- 'Text.'],
- ['no_top_node',
- '@node node Top not Top node
- '],
- ['paragraphindent_and_preamble',
- '@copying
- In copying.
- Copying second para.
- @end copying
- @node Top
- @top test @@paragraphindent effect in preamble
- First para.
- Before paragraphindent.
- @paragraphindent 1
- After paragraphindent.
- @bye
- '],
- ['paragraphindent_asis_first',
- '
- bbb
- @paragraphindent asis
- ccc
- '],
- ['paragraphindent_none_first',
- '
- first
- second
- @paragraphindent none
- after none
- '],
- ['space_at_menu_end',
- '@node Top
- @menu
- * (out)::
- @end menu
- A para.
- '],
- ['space_in_menu',
- '@node Top
- @top Element
- Text.
- @menu
- * node::
- @end menu
- @node node
- @chapter node
- in chapter.
- '],
- ['text_before_node',
- '@node Top
- @top top
- @menu
- * chapter node::
- @end menu
- text.
- @node chapter node
- @chapter chapter'
- ],
- ['ref_tests',
- '
- @node Top
- @ref{(m)in ref followed by comma},
- @ref{(m)in ref not followed by comma} after ref.
- @code{@ref{(m)in ref followed by end command}}.
- @ref{(m)in ref followed by comma, name},
- @ref{(m)in ref not followed by comma, name} after ref.
- @code{@ref{(m)in ref followed by end command, name}}.
- @ref{(m)in ref ending with a dot., name} after ref.
- '],
- ['xref_test',
- '
- @node Top
- @xref{(m)in xref}. @xref{(m)bad xref} after xref.
- @code{@xref{(m)bad nested xref}}.
- @xref{(m)in ref ending with a dot., name} ! after xref and dot inside.
- @xref{(m)in ref followed by symbol}# g.
- '],
- ['pxref_test',
- '@node Top
- Hey (@pxref{(m) in pxref}) and continue (@pxref{(m) in pxref, name}) and end.
- @pxref{(m) n}. @pxref{(m) n, name}.
- '],
- ['contents_setcontentsaftertitlepage_before_node',
- '
- @contents
- @setcontentsaftertitlepage
- @node Top
- @top Double contents
- '],
- ['anchor_in_command',
- '@node Top
- @strong{aaa @TeX{} @emph{in emph} after
- @c emph @emph{emph2 @anchor{anchor in emph} }}.
- emph @emph{emph2 @anchor{anchor in emph}}}.
- '],
- ['anchor_and_spaces',
- '@node Top
- @top Element
- @anchor{anchor 0}
- Now @anchor{anchor1}.
- No space@anchor{anchor2}.
- '],
- ['before_node_and_section',
- 'Garbage
- ref to Top @ref{Top}.
- @cindex index entry before anything
- Hey@footnote{a footnote}.
- An anchor @anchor{anchor1}.
- @menu
- * node1::
- @end menu
- @node Top
- @top top @@top section
- Node top
- ref to anchor1@footnote{another footnote}, which is before @@node Top: @ref{anchor1}.
- @menu
- * node1::
- @end menu
- @node node1
- @chapter node1 chapter
- @printindex cp
- '],
- ['image_quotes',
- '@node Top
- @image{f--ile,,,alt""\\}
- '],
- ['image_in_paragraph',
- '@node Top
- Para.
- @image{f--ile,,,alt""\\}. End para.
- '],
- ['image_not_found',
- '@node Top
- @image{n_f_image}
- '],
- ['image_file_search',
- '@node Top
- @c does not work in the standalone perl module
- @c @image{tp/t/include_dir/f--ile}
- @@image dot.
- @image{./tp/t/include_dir/f--ile}
- @@image dot parent.
- @image{../include_dir/f--ile}
- ',{'include_directories' => ['.', '..', 't/include_dir']}],
- ['image_extension',
- '@node Top
- @image{fext,,,,ext}
- @image{fdotext,,,,ext}
- @image{f--ile,,,,ext}
- '],
- ['image_text_encoded',
- '@documentencoding utf-8
- @image{image_encoded}
- '],
- ['image_and_spaces_formatting',
- '@node Top
- @image{words} @image{words} @image{words} @image{words} @image{words} @image{words} @image{words}
- Some text @image{words} @image{words} @image{words} @image{words} @image{words} @image{words} @image{words}.
- Some text @image{words} text aaaaaaaaa @image{words} text bbbbbbbbbbb @image{words} text ccccccccccccc @image{words} text ddddddddddddd @image{words} text eeeeeeeeeeeeeee @image{words} text fffffffffff @image{words}.
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA @image{words}
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBB @image{words}
- Text. @image{words} @image{words}.
- '],
- ['image_and_punctuation',
- '@node Top
- One space. @image{f--ile}.
- Two spaces. @image{f--ile}.
- End line.
- @image{f--ile}.
- One space. @image{words}.
- Two spaces. @image{words}.
- End line.
- @image{words}.
- '],
- [ 'multitable_anchor_and_index_entry',
- '@node Top
- @multitable @columnfractions 0.4 0.6
- @headitem mu--ltitable headitem @tab another tab
- @item mu--ltitable item @tab multitable tab
- @c comment in multitable
- @item mu--ltitable item 2 @tab multitable tab 2
- @cindex index entry within multitable
- @anchor{anchor in multitable}
- @item lone mu--ltitable item
- @end multitable
- @multitable {A} {B}
- @item A
- B
- C
- @tab G
- @item lsfd mlkdsf lk s
- mlsdmjlfdsjm mdsfk
- @cindex index entry
- @item lsfd2 mlkdsf2 lk2 s2
- mlsdmjlfdsjm mdsfk2
- @tab ATTTTTTTTTTTTTTTTTTTTT
- BTTTTTTt @anchor{mark}
- CTTTTTT
- @end multitable
- @printindex cp
- @ref{mark}
- @ref{anchor in multitable}
- '],
- ['note_in_strong',
- '@node Top
- 3 One @strong{Note}.
- 5 @strong{Note a}.
- 9 @strong{note}.
- 11 @strong{note b}.
- 13 @strong{ note}.
- 15 @strong{note-bbb}.
- '],
- ['note_in_strong_end_of_line',
- '@node Top
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb vvvvvvvvvvvvvvvv @strong{note a}
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb vvvvvvvvvvvvvvvv @strong{note
- a}
- '],
- ['nested_multitable_anchor_index',
- '@node Top
- @multitable {truc AAAA machin} {bidule}
- @item
- @multitable {AAAA} {machin}
- @item AAAA @tab machin @anchor{mark inside}
- @cindex index entry inside
- @end multitable
- @tab bidule
- @item other item @tab in tab @anchor{mark}
- @cindex index entry
- @end multitable
- @printindex cp
- @xref{mark}.
- @xref{mark inside}.
- '],
- ['def_in_copying',
- '@macro mymacro
- @deffn aa bb cc
- @deffnx aax bbx ccx
- deffnx lines
- @end deffn
- @end macro
- @node Top
- @top Test for definition commands
- @copying
- In copying
- @mymacro{}
- @end copying
- In text
- @mymacro{}
- @printindex fn
- '],
- ['file_only_png',
- '@node Top
- Just before an image @image{this_is_a_long_unknown_file} text after the image, and more text, and more @image{this_is_a_long_unknown_file} text.
- '],
- ['float_long_captions',
- '@node Top
- @float Text, text1
- @caption{AAAAAAAAAAAAAAAA BBBBB CCCCCCCCCCC}
- @end float
- @float Text, text2
- @caption{AAAAAAAAAAAAAAAA BBBBBB CCCCCCCCCCC}
- @end float
- @listoffloats Text
- '],
- ['error_in_footnote',
- '
- @node Top
- @float Text, label
- Float text1
- @caption{Caption. @TeX.
- In caption @strong{note caption}.
- Now footnote@footnote{@LaTeX.
- and strong @strong{Note footnote}.}}
- @end float
- @listoffloats Text
- @listoffloats Text
- '],
- ['nested_footnotes_separate',
- '@footnotestyle separate
- @node Top
- F@footnote{F1
- V@footnote{F2}
- }
- '],
- ['encoding_us_ascii',
- '
- @documentencoding US-ASCII
- @node Top
- '],
- ['known_encoding',
- '
- @documentencoding latin1
- @node Top
- '],
- ['unknown_encoding',
- '
- @documentencoding ggg
- @node Top
- '],
- ['top_node_normalization',
- '@node ToP
- @xref{TOP}. @xref{tOP}.
- @menu
- * tOP::
- @end menu
- '],
- # since there is no split in the test suite, there is no split tested
- # here, in fact.
- ['split_no_copying',
- '\input texinfo
- @setfilename split-nocopying.info
- @node Top
- @top Top
- This is the top node.
- @menu
- * Ch1::
- @end menu
- @node Ch1
- @chapter Ch1
- First chapter.
- @bye
- ',{},{'SPLIT_SIZE' => 10}],
- ['no_node_but_top',
- '@top top
- '],
- ['space_in_setfilename',
- '@setfilename @ @verb{: name :}@
- @node Top
- '],
- ['novalidate_empty_refs',
- '
- @novalidate
- @node Top
- @xref{@:}.
- @xref{@asis{ }}.
- @node @
- @node @:
- @node @asis{ }
- '],
- ['invalid_node_name_warning',
- $invalid_node_name_text
- ],
- ['invalid_node_name_no_warning',
- $invalid_node_name_text,
- {},{'INFO_SPECIAL_CHARS_WARNING' => 0}
- ],
- ['only_documentencoding',
- '@documentencoding ISO-8859-1'],
- ['direntry_dircategory_and_commands',
- '@dircategory ``category---@var{th ere}?\'\'
- @direntry
- * foo: (foo). ``hello---@var{there}?\'\'
- @end direntry
- @dircategory cat2
- @direntry
- * aaa :: aaaa
- bbbbb
- menutitle
- @end direntry
- @node Top
- @top Test dircategory and direntry
- Text
- '],
- ['colon_in_index_entry',
- '@node Top
- @synindex vr cp
- @cindex a:b
- @vtable @emph
- @item %main::value
- @end vtable
- @defvr {a:b} {c:d} e f
- @defvrx {x:y} {z:t} n m o
- @end defvr
- @printindex cp
- '],
- ['test_index',
- '@node Top
- @top Element top
- @xref{a counting anchor}.
- before menu.
- @cindex in Top
- @cindex @@
- @cindex @exclamdown{}
- @cindex "
- @deffn fset @var{i} a g
- @deffnx truc machin bidule chose
- @end deffn
- @ftable @emph
- @item a fun
- Var text
- @item second fun
- @itemx itemx fun
- @end ftable
- @menu
- * name::
- * name1 looooooooooooooooooooooooooooooooooooooooooooooooooooooooong::
- @end menu
- @node name
- @chapter A chapter
- @cindex index entry looooooooooooooooooooooooooooooooooooooooooooooooooooooooong
- @findex function index entry
- A paragraph
- @findex other function
- end paragraph
- a
- a
- a
- a
- a
- @findex after lines.
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- b
- @findex after more than 100 lines
- @node name1 looooooooooooooooooooooooooooooooooooooooooooooooooooooooong
- @appendix Index
- @cindex index entry in appendix before para
- Para.
- Concept index
- @printindex cp
- @findex index entry between indices
- Functions index
- @printindex fn
- @appendixsec appendixsec
- @appendixsubsec appendixsubsec
- @appendixsubsubsec appendixsubsubsec
- @chapheading chapheading
- @centerchap centerchap
- @chapter chapter end
- @cindex index in chapter end
- @anchor{a counting anchor}
- @bye
- '],
- ['index_entry_at_end_node',
- '@node Top
- @top Element
- @menu
- * chapter::
- * indices::
- @end menu
- @node chapter
- @chapter Chapter
- @cindex index entry
- @node indices
- @appendix indices
- @printindex cp
- '],
- ['center_flush',
- '@center centered
- @flushleft
- left and
- left2
- left3.
- left Last
- with space.
- Now anchor
- @anchor{anchor in flushleft}
- after anchor
- @end flushleft
- @flushright
- right and
- right2
- Right3
- Right last
- with space.
- Now anchor
- @anchor{anchor in flushright}
- after anchor
- Second anchor in text @anchor{second anchor in flushright} after anchor.
- @end flushright
- '],
- # if this test is changed, the corresponding test in t/plaintext_tests.t
- # should be changed too
- ['multiline_image_and_align',
- '@center @image{figure}
- @center CCCC @image{figure}
- @center fffffffffffffffffffffffffffffffffffffff @image{figure}
- @center dddd @image{figure} iiiii
- @flushright
- AAA
- @image{figure}
- BBB @image{figure} gggg @image{figure}
- HHH
- @image{figure} JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ
- @end flushright
- @center @image{figure, , , ,txt}
- @center CCCC @image{figure, , , ,txt}
-
- @center fffffffffffffffffffffffffffffffffffffff @image{figure, , , ,txt}
- @center dddd @image{figure, , , ,txt} iiiii
- @flushright
- AAA
- @image{figure, , , ,txt}
- BBB @image{figure, , , ,txt} gggg @image{figure, , , ,txt}
- HHH
- @image{figure, , , ,txt} JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ
- @end flushright
- '],
- );
- my @file_tests = (
- ['split_test_before_first_node',
- '@setfilename split_test_before_first_node.info
- truc machin et reuc machin ze aze zea zae eaz eaz zae
- @node Top
- @top top
- In top node
- @menu
- * chap1::
- @end menu
- @node chap1
- @chapter chap
- In chap1.
- ',{},{'SPLIT_SIZE' => 10}],
- ['split_test_before_first_node_no_empty_line',
- '@setfilename split_test_before_first_node.info
- truc machin et reuc machin ze aze zea zae eaz eaz zae
- @node Top
- @top top
- In top node
- @menu
- * chap1::
- @end menu
- @node chap1
- @chapter chap
- In chap1.
- ',{},{'SPLIT_SIZE' => 10}],
- );
- foreach my $test (@test_cases) {
- push @{$test->[2]->{'test_formats'}}, 'info';
- }
- foreach my $test (@file_tests) {
- push @{$test->[2]->{'test_formats'}}, 'file_info';
- }
- our ($arg_test_case, $arg_generate, $arg_debug);
- run_all ('info_tests', [@test_cases, @file_tests], $arg_test_case,
- $arg_generate, $arg_debug);
- 1;
|