mirror of
https://github.com/nodejs/node.git
synced 2025-05-08 05:00:21 +00:00

PR-URL: https://github.com/nodejs/node/pull/15343 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
32 lines
745 B
JavaScript
32 lines
745 B
JavaScript
'use strict';
|
|
const common = require('../../common');
|
|
const assert = require('assert');
|
|
|
|
// testing api calls for function
|
|
const test_function = require(`./build/${common.buildType}/test_function`);
|
|
|
|
|
|
function func1() {
|
|
return 1;
|
|
}
|
|
assert.strictEqual(test_function.TestCall(func1), 1);
|
|
|
|
function func2() {
|
|
console.log('hello world!');
|
|
return null;
|
|
}
|
|
assert.strictEqual(test_function.TestCall(func2), null);
|
|
|
|
function func3(input) {
|
|
return input + 1;
|
|
}
|
|
assert.strictEqual(test_function.TestCall(func3, 1), 2);
|
|
|
|
function func4(input) {
|
|
return func3(input);
|
|
}
|
|
assert.strictEqual(test_function.TestCall(func4, 1), 2);
|
|
|
|
assert.strictEqual(test_function.TestName.name, 'Name');
|
|
assert.strictEqual(test_function.TestNameShort.name, 'Name_');
|