Skip to content

Commit

Permalink
Solve bugs from configuration node port test and node port fn depende…
Browse files Browse the repository at this point in the history
…ncy.
  • Loading branch information
viferga committed Dec 27, 2022
1 parent d98278f commit 6e3dabd
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions source/ports/node_port/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@ describe('metacall', () => {
assert.strictEqual(py_encode_basestring_ascii('asd'), '"asd"');
});
it('require (py submodule dependency)', () => {
// Require the 'op' submodule from 'fn' Python package
const { foldr, call } = require('fn.op');
// Require the 'core' submodule from 'rsa' Python package
const { encrypt_int } = require('rsa.core');

assert.strictEqual(foldr(call, 10)([s => s * s, k => k + 10]), 400);
assert.strictEqual(encrypt_int(3, 2, 5), 4);
});
it('require (rb)', () => {
const cache = require('./cache.rb');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ target_compile_definitions(${target}
PRIVATE
${DEFAULT_COMPILE_DEFINITIONS}

# Python Port path
METACALL_PYTHON_PORT_PATH="${CMAKE_SOURCE_DIR}/source/ports/py_port"

# NodeJS Port path
METACALL_NODE_PORT_PATH="${CMAKE_SOURCE_DIR}/source/ports/node_port/index.js"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ TEST_F(metacall_load_configuration_node_python_test, DefaultConstructor)

ASSERT_EQ((int)0, (int)metacall_initialize());

ASSERT_EQ((int)0, (int)metacall_execution_path("py", METACALL_PYTHON_PORT_PATH));

static const char buffer[] =
"const { metacall_load_from_configuration_export } = require('" METACALL_NODE_PORT_PATH "');\n"
"const config = metacall_load_from_configuration_export('" METACALL_TEST_CONFIG_PATH "');\n"
Expand Down
1 change: 0 additions & 1 deletion tools/metacall-environment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ function sub-python {
pip3 install setuptools
pip3 install wheel
pip3 install rsa
pip3 install fn
pip3 install scipy
pip3 install numpy
pip3 install scikit-learn
Expand Down
1 change: 0 additions & 1 deletion tools/metacall-environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ sub_python(){
$SUDO_CMD pip3 install setuptools
$SUDO_CMD pip3 install wheel
$SUDO_CMD pip3 install rsa
$SUDO_CMD pip3 install fn
$SUDO_CMD pip3 install scipy
$SUDO_CMD pip3 install numpy
$SUDO_CMD pip3 install scikit-learn
Expand Down

0 comments on commit 6e3dabd

Please sign in to comment.