summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/luatex/luatexbase/test-mcb-plain.tex
blob: 7108e4910d695dd933da08dc203659ce2f243a48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
%%
%% This is file `test-mcb-plain.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% luatexbase-mcb.dtx  (with options: `testplain')
%% 
%% See the aforementioned source file(s) for copyright and licensing information.
%% 
\input luatexbase-mcb.sty
\catcode 64 11
\def\msg{\immediate\write16}
\msg{===== BEGIN =====}
\luatexbase@directlua{dofile('test-mcb.lua')}
\def\test#1#2{%
  \msg{^^J*********^^J* Testing #1 (type #2)^^J*********}
  \msg{* Add two functions}
  \luatexbase@directlua{add_#1()}
  \csname test_#1\endcsname
  \msg{* Remove one}
  \luatexbase@directlua{rm_one_#1()}
  \csname test_#1\endcsname
  \msg{* Remove the second}
  \luatexbase@directlua{rm_two_#1()}
  \csname test_#1\endcsname
  \msg{* Add two functions again}
  \luatexbase@directlua{add_#1()}
  \csname test_#1\endcsname
  \msg{* Remove all functions}
  \luatexbase@directlua{luatexbase.reset_callback("#1")}
  \csname test_#1\endcsname
}
\catcode`\_ 11
\def\test_hpack_filter{\setbox0=\hbox{bla}}
\def\test_hyphenate{\showhyphens{hyphenation}}
\def\test_find_write_file{\immediate\openout15 test-mcb-out.log}
\def\test_process_input_buffer{\input test-mcb-aux.tex}
\test{hpack_filter}{list}
\test{hyphenate}{simple}
\test{find_write_file}{first}
\test{process_input_buffer}{data}
\msg{=====  END =====}
\bye
\endinput
%%
%% End of file `test-mcb-plain.tex'.