Skip to content

Commit 9957043

Browse files
committed
Add a bit of doc in failing test.
1 parent 56f183d commit 9957043

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

source/tests/metacall_node_python_port_mock_test/source/metacall_node_python_port_mock_test.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,14 @@ TEST_F(metacall_node_python_port_mock_test, DefaultConstructor)
5050
"import metacall\n"
5151
/* Mock */
5252
"from asd.mock import two_doubles\n"
53-
"def py_func(js_func):\n"
54-
" return js_func(two_doubles)\n"
53+
"print('........................................................')\n"
54+
"print(two_doubles(3.0, 6.0))\n" // This works
55+
"print('........................................................')\n"
56+
"def py_func(cb):\n"
57+
" return cb(two_doubles)\n"
58+
"print(py_func(lambda f: f(3, 4)))\n" // This works too
5559
"`);\n"
60+
// This does not, probably the error is when converting mock_func from metacall value to napi:
5661
"const result = metacall('py_func', (mock_func) => mock_func(3, 4));\n"
5762
"console.log('Result:', result);\n"
5863
"if (result !== 3.1416) process.exit(1);\n";

0 commit comments

Comments
 (0)