projects
/
project
/
firewall4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
281b1bc
)
tests: mocklib: fix infinite recursion in wrapped print()
author
Jo-Philipp Wich
<
[email protected]
>
Sat, 12 Feb 2022 18:36:27 +0000
(19:36 +0100)
committer
Jo-Philipp Wich
<
[email protected]
>
Sat, 12 Feb 2022 19:36:57 +0000
(20:36 +0100)
Signed-off-by: Jo-Philipp Wich <
[email protected]
>
tests/lib/mocklib.uc
patch
|
blob
|
history
diff --git
a/tests/lib/mocklib.uc
b/tests/lib/mocklib.uc
index 5441bfbffe824644afb08cf8942292f544e140b3..d47ebf300ecd15a657bfdfcb8ac1d81a5e2fd301 100644
(file)
--- a/
tests/lib/mocklib.uc
+++ b/
tests/lib/mocklib.uc
@@
-180,6
+180,8
@@
if (type(MOCK_SEARCH_PATH) != 'array' || length(MOCK_SEARCH_PATH) == 0)
MOCK_SEARCH_PATH = [ './mocks' ];
+ let _print = global.print;
+
/* Register global mocklib namespace */
global.mocklib = {
require: function(module) {
@@
-232,7
+234,7
@@
if (length(args) == 1 && type(args[0]) in ["array", "object"])
printf("%s\n", format_json(args[0]));
else
-
global.
print(...args);
+
_
print(...args);
};
return global.mocklib;