Skip to content

Commit

Permalink
Add a bit of doc in failing test.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Apr 14, 2021
1 parent 56f183d commit 9957043
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,14 @@ TEST_F(metacall_node_python_port_mock_test, DefaultConstructor)
"import metacall\n"
/* Mock */
"from asd.mock import two_doubles\n"
"def py_func(js_func):\n"
" return js_func(two_doubles)\n"
"print('........................................................')\n"
"print(two_doubles(3.0, 6.0))\n" // This works
"print('........................................................')\n"
"def py_func(cb):\n"
" return cb(two_doubles)\n"
"print(py_func(lambda f: f(3, 4)))\n" // This works too
"`);\n"
// This does not, probably the error is when converting mock_func from metacall value to napi:
"const result = metacall('py_func', (mock_func) => mock_func(3, 4));\n"
"console.log('Result:', result);\n"
"if (result !== 3.1416) process.exit(1);\n";
Expand Down

0 comments on commit 9957043

Please sign in to comment.