summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2010-11-06 04:56:28 +0100
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2010-11-11 15:52:25 +0100
commit79b6ef89336fe7dcbb41250636f28ab4ebf03584 (patch)
tree539bd87779eb347fdb9f1dd74c5f9fb4fc330394
parentcf38e5245cd08bbf262618260c269536903ad0ee (diff)
downloadluatexbase-79b6ef89336fe7dcbb41250636f28ab4ebf03584.tar.gz
mcb: make test results more readable
-rw-r--r--luatexbase-mcb.dtx13
1 files changed, 12 insertions, 1 deletions
diff --git a/luatexbase-mcb.dtx b/luatexbase-mcb.dtx
index cb04f82..e170a5b 100644
--- a/luatexbase-mcb.dtx
+++ b/luatexbase-mcb.dtx
@@ -879,6 +879,7 @@ end
%
% \begin{macrocode}
%<*testlua>
+local msg = texio.write_nl
% \end{macrocode}
%
% Test the management functions with a predefined callback.
@@ -888,6 +889,7 @@ local function sample(head,...)
return head, true
end
local prio = luatexbase.priority_in_callback
+msg("\n*********\n* Testing management functions\n*********")
luatexbase.add_to_callback("hpack_filter", sample, "sample one", 1)
luatexbase.add_to_callback("hpack_filter", sample, "sample two", 2)
luatexbase.add_to_callback("hpack_filter", sample, "sample three", 1)
@@ -914,14 +916,23 @@ local function data_three(s)
texio.write_nl("I'm data 3 whith argument: "..s)
return s
end
+msg("\n*********\n* Testing user-defined callbacks\n*********")
+msg("* create one")
luatexbase.create_callback("fooback", "data", data_one)
+msg("* call it")
luatexbase.call_callback("fooback", "default")
+msg("* add two functions")
luatexbase.add_to_callback("fooback", data_two, " function two", 2)
luatexbase.add_to_callback("fooback", data_three, " function three", 1)
+msg("* call")
luatexbase.call_callback("fooback", "all")
+msg("* rm one function")
luatexbase.remove_from_callback("fooback", " function three")
+msg("* call")
luatexbase.call_callback("fooback", "all but three")
+msg("* reset")
luatexbase.reset_callback("fooback")
+msg("* call")
luatexbase.call_callback("fooback", "default")
% \end{macrocode}
%
@@ -1051,7 +1062,7 @@ end
%
% \begin{macrocode}
\def\test#1{%
- \msg{^^J*****^^J* Testing #1^^J*****}
+ \msg{^^J*********^^J* Testing #1^^J*********}
\msg{* Add two functions}
\luatexbase@directlua{add_#1()}
\csname test_#1\endcsname